Example #1
0
 public function insert(array $data)
 {
     if (substr($data['entity'], 0, strlen('date')) === 'date') {
         $data['value'] = strtotime($data['value']);
     }
     return parent::insert($data);
 }
Example #2
0
 /**
  *
  * @param array $data
  * @return mixed
  */
 public function insert(array $data)
 {
     if (empty($data['created_on'])) {
         $data['created_on'] = Axis_Date::now()->toSQLString();
     }
     return parent::insert($data);
 }
Example #3
0
 /**
  * @param array $data
  * @return mixed
  */
 public function logging(array $data = array())
 {
     $pdata = array('num_results' => $data['num_results'], 'created_at' => Axis_Date::now()->toSQLString(), 'visitor_id' => Axis::single('log/visitor')->getVisitor()->id, 'customer_id' => Axis::getCustomerId(), 'site_id' => Axis::getSiteId());
     $query = Axis::single('search/log_query')->getQuery($data['query']);
     $query->hit++;
     $query->save();
     $pdata['query_id'] = $query->id;
     /* @todo analize search query */
     return parent::insert($pdata);
 }
Example #4
0
 /**
  *
  * @param array $data
  * @return mixed
  */
 public function insert(array $data)
 {
     if (empty($data['weight'])) {
         $data['weight'] = '0';
     }
     if (empty($data['price'])) {
         $data['price'] = '0';
     }
     return parent::insert($data);
 }
Example #5
0
 public function deleteByIds(array $ids)
 {
     if (!count($ids)) {
         return false;
     }
     $where = $this->getAdapter()->quoteInto('id IN(?)', $ids);
     if ($result = parent::delete($where)) {
         Axis::message()->addSuccess(Axis::translate('admin')->__('Profile was deleted successfully'));
     }
     return $result;
 }
Example #6
0
 public function getCount()
 {
     return parent::count(null, 'COUNT(id)');
 }
Example #7
0
 /**
  *
  * @param array $where
  * @return int          The number of rows deleted. 
  */
 public function delete($where)
 {
     $where = $this->getAdapter()->quoteInto('id IN(?)', $where);
     return parent::delete($where);
 }