示例#1
0
 /**
  * Rewriting of parent method.
  * Added support for date and hit filtering
  *
  * @param array $filters
  * <pre>
  *  array(
  *      0 => array(
  *          field       => table_column
  *          value       => column_value
  *          operator    => =|>|<|IN|LIKE    [optional]
  *          table       => table_correlation[optional]
  *      )
  *  )
  * </pre>
  * @return Axis_Db_Table_Select
  */
 public function addFilters(array $filters)
 {
     foreach ($filters as $key => $filter) {
         if ('date' != $filter['field'] && 'hit' != $filter['field']) {
             continue;
         }
         $this->having("{$filter['field']} {$filter['operator']} ?", $filter['value']);
         unset($filters[$key]);
     }
     return parent::addFilters($filters);
 }
示例#2
0
 /**
  * Rewriting of parent method
  * Add having statement if filter by page_name is required
  *
  * @param array $filters
  * <pre>
  *  array(
  *      0 => array(
  *          field       => table_column
  *          value       => column_value
  *          operator    => =|>|<|IN|LIKE    [optional]
  *          table       => table_correlation[optional]
  *      )
  *  )
  * </pre>
  * @return Axis_Core_Model_Template_Box_Select
  */
 public function addFilters(array $filters)
 {
     foreach ($filters as $key => $filter) {
         if ('page_name' != $filter['field']) {
             continue;
         }
         $this->having("page_name LIKE ?", '%' . $filter['value'] . '%');
         unset($filters[$key]);
         break;
     }
     return parent::addFilters($filters);
 }
示例#3
0
 /**
  * Rewriting of parent method
  * Make it work with backend filter by valueset
  *
  * @param array $filters
  * <pre>
  *  array(
  *      0 => array(
  *          field       => table_column
  *          value       => column_value
  *          operator    => =|>|<|IN|LIKE    [optional]
  *          table       => table_correlation[optional]
  *      )
  *  )
  * </pre>
  * @return Axis_Account_Model_Customer_Field_Select
  */
 public function addFilters(array $filters)
 {
     foreach ($filters as $key => $filter) {
         if ('customer_valueset_id' != $filter['field']) {
             continue;
         }
         if (0 == $filter['value']) {
             $this->where("customer_valueset_id IS NULL");
             unset($filters[$key]);
         }
         break;
     }
     return parent::addFilters($filters);
 }
示例#4
0
 /**
  * Class constructor
  *
  * @param Zend_Db_Table_Abstract $adapter
  */
 public function __construct(Zend_Db_Table_Abstract $table)
 {
     self::$_partsInit = array_merge(array(self::SQL_CALC_FOUND_ROWS => false), self::$_partsInit);
     parent::__construct($table);
 }
示例#5
0
 /**
  * Rewriting of parent method.
  * Added support for customer_name and order_total in customer currency filtering
  *
  * @param array $filters
  * <pre>
  *  array(
  *      0 => array(
  *          field       => table_column
  *          value       => column_value
  *          operator    => =|>|<|IN|LIKE    [optional]
  *          table       => table_correlation[optional]
  *      )
  *  )
  * </pre>
  * @return Axis_Sales_Model_Order_Select
  */
 public function addFilters(array $filters)
 {
     foreach ($filters as $key => $filter) {
         if ('customer_name' == $filter['field']) {
             $this->where("CONCAT(firstname, ' ', lastname) LIKE ?", '%' . $filter['value'] . '%');
             unset($filters[$key]);
         } else {
             if ('order_total_customer' == $filter['field']) {
                 $this->having("{$filter['field']} {$filter['operator']} ?", $filter['value']);
                 unset($filters[$key]);
             }
         }
     }
     return parent::addFilters($filters);
 }