Created
September 23, 2021 11:02
-
-
Save Sentinel-7/c29abb0ed90ed4ae84cad512610b2987 to your computer and use it in GitHub Desktop.
Замена tickets на msProducts (замена тикетов на товары)
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 characters
<?php | |
// Id корня, глубина, контекст | |
$child = $modx->getChildIds(11, 10, array('context' => 'web')); | |
$q = $modx->newQuery('Ticket'); | |
$q->where(array( | |
'id:IN' => $child, | |
'published' => true, | |
'deleted' => false, | |
'searchable' => true, | |
)); | |
$products = $modx->getIterator('Ticket', $q); | |
foreach ($products as $k => $product) { | |
$product->set('class_key', 'msProduct'); | |
$product->save(); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment