public function getList() { $arrCriteria = array('a.admin LIKE ?' => '%' . $this->_filters['admin'] . '%', 'a.description LIKE ?' => '%' . $this->_filters['description'] . '%'); if ($this->_filters['action'] != '0' && $this->_filters['action'] != '') { $arrCriteria['a.action = ?'] = $this->_filters['action']; } if ($this->_filters['tbl'] != '0' && $this->_filters['tbl'] != '') { $arrCriteria['a.tbl = ?'] = $this->_filters['tbl']; } //$arrCriteria['a.name IN (?)'] = array_keys($this->getDropdownName()); $select = new Select('log'); $select->addField('id_log'); $select->addField('admin'); $select->addField('tbl'); $select->addField('inc_date'); $select->addField('action'); $select->addField('description'); $select->where($arrCriteria); $select->order_by('a.inc_date DESC'); $this->_paginator = new PaginatorAdmin($this->_itens_per_page, $this->_filters['pag']); $this->setPaginationSelect($select); $result = $this->_dao->select($select); foreach ($result as $i => $row) { $result[$i]['action'] = Arrays::$logAcao[$row['action']]; $result[$i]['inc_date'] = DateFormat::filter_date($row['inc_date'], 'd/m/Y H:i:s'); $entity = $this->_entities->getEntity($row['tbl']); $result[$i]['tbl'] = $entity->getSection(); } return $result; }
public function getTweets() { $entity_id = $this->_entity->getId(); $entity_tbl = $this->_entity->getTbl(); $select = new Select('tweet'); $select->addField('date'); $select->addField('msg'); $select->inner_join('id_tweet', Select::construct("r_{$entity_tbl}_tweet")); $select->where(array("b.{$entity_id} = ?" => $this->getId())); $select->order_by('date DESC'); $result = $this->_dao->select($select); return $result; }
public function getList($arrCriteria = array()) { $select = new Select($this->_photo_item); $select->addField($this->_id_photo, 'id_photo'); $select->addField($this->_id_photo_item, 'id_photo_item'); $select->addField('label'); $select->addField('credit'); $select->addField('file'); $select->addField('sequence'); $select->where($arrCriteria); $select->order_by('sequence'); $result = $this->_dao->select($select); return $result; }
/** * * @param String $id * @return String/Json */ public function getAjaxCurrent($id) { $ce_tbl = $this->_current_entity->getTbl(); $ce_id = $this->_current_entity->getId(); $fe_tbl = $this->_foreign_entity->getTbl(); $fe_id = $this->_foreign_entity->getId(); $fe_title = $this->_foreign_entity->getTitle(); $tableRelationship = "r_{$ce_tbl}_{$fe_tbl}"; $arrCriteria["{$ce_id} = ?"] = $id; if ($this->_foreign_entity->hasTrash()) { $arrCriteria['is_del = ?'] = '0'; } $select = new Select($fe_tbl); $select->addField($fe_id, 'id'); $select->addField($fe_title, 'text'); $select->inner_join($fe_id, Select::construct($tableRelationship)); $select->where($arrCriteria); $select->order_by('b.sequence'); $result = $this->_dao->select($select); return $result; }