Created
January 13, 2020 13:31
-
-
Save dzhuryn/2ef410548d75bb4192f0898170ade9f9 to your computer and use it in GitHub Desktop.
modResource example
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
require_once MODX_BASE_PATH.'assets/lib/MODxAPI/modResource.php'; | |
$R = $modx->getFullTableName('site_content'); | |
$sql = "select id from $R where `template` in (5,21)"; | |
$docs = $modx->db->makeArray($modx->db->query($sql)); | |
foreach ($docs as $doc) { | |
$obj = new modResource($modx); | |
$obj->edit($doc['id']); | |
$obj->save(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment