Example #1
0
 public function outputArray(array $array, $count = false)
 {
     $result = parent::outputArray($array, $count);
     if ($this->getProperty('grid')) {
         $data = array();
         if (!empty($result['object'])) {
             foreach ($result['object'] as $a) {
                 $data[] = $a;
             }
         }
         return '{"total":"' . $count . '","results":' . $this->modx->toJSON($data) . '}';
     }
     // else
     return $result;
 }
Example #2
0
 public function prepareQueryBeforeCount(xPDOQuery $c)
 {
     $c = parent::prepareQueryBeforeCount($c);
     $c->where(array("order_id" => $this->getProperty('order_id')));
     return $c;
 }