ресурсов с определенным шаблоном
                  
                  
                  <?php
                  
                  
                  $count = 0;
                  
                  
                  $parent = $modx->getOption('parent', $scriptProperties, 0);
                  
                  
                  $query = $modx->newQuery('modResource', array('parent' => $parent, 'depth' => 10, 'deleted' => 0, 'published' => 1, 'template' => 5));
                  
                  
                  $query->select(array('count'=>'count(id)'));
                  
                  
                  if ($query->prepare() && $query->stmt->execute()) {
                  
                  
                      $res = $query->stmt->fetch(PDO::FETCH_ASSOC);
                  
                  
                      $count = $res['count'];
                  
                  
                  }
                  
                  
                  return $count;
                  
                  
                  подскажите пожалуйста как указать глубину выборки
                  
                  
                
'depth' => 10 тут глубина!
у меня есть
$query = $modx->newQuery('modResource', array('parent' => $parent, 'depth' => 10, 'deleted' => 0, 'published' => 1, 'template' => 5));
ну и чудненько :))
нет такого свойства как depth в критериях)
а как сделать глубину поиска?
Обсуждают сегодня