Created
May 12, 2018 04:31
-
-
Save pavel-one/9ec3d57cf539e5841afee7aee7724e8f to your computer and use it in GitHub Desktop.
Revisions
-
pavel-one created this gist
May 12, 2018 .There are no files selected for viewing
This file contains hidden or 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 charactersOriginal file line number Diff line number Diff line change @@ -0,0 +1,24 @@ <?php //@EVAL return $modx->runSnippet('getDepartament'); $pdo = $modx->getService('pdoFetch'); $pdo->setConfig(array( 'parents' => 137, 'limit' => 0, 'sortby' => 'id', 'select' => 'id,pagetitle', 'return' => 'data', 'where' => [ 'isfolder' => 1, ] )); $arr = $pdo->run(); $outArr = array(); foreach ($arr as $item) { $outArr[] = $item['pagetitle'].'=='.$item['id']; } $out = implode('||', $outArr); return $out;