Ejemplo n.º 1
0
 protected function _filterToPredicate($field, $predicate)
 {
     if (strtolower($field) == 'categories' && !$predicate instanceof Predicate) {
         // Handle split amount
         $predicateSet = new PredicateSet();
         $predicateSet->addPredicate(parent::_filterToPredicate('category', $predicate));
         $secondField = new Expression('(SELECT category FROM ' . Operation::SPLIT_AMOUNT_TABLE . ' WHERE operation_id = main_table.id)');
         $predicateSet->addPredicate(parent::_filterToPredicate($secondField, $predicate), Predicate::OP_OR);
         return $predicateSet;
     }
     return parent::_filterToPredicate($field, $predicate);
 }
Ejemplo n.º 2
0
 public function __construct($params = array())
 {
     parent::__construct($params);
     $this->_init(\Xhb\Model\Xhb::MODEL_CLASS_NAMESPACE . 'Category', 'key', \Xhb\Model\Resource\Db\Category::MAIN_TABLE);
 }