public function fetchAll() { $select = new Select('socialmedia_credentials'); $select->addAllFields(); $result = $this->_dao->select($select); $this->row = $result[0]; }
public function getById($id = null) { if ($id) { $this->setId($id); } $arrCriteria = array('id_log = ?' => $this->getId()); $select = new Select('log'); $select->addAllFields(); $select->where($arrCriteria); $result = $this->_dao->select($select); if (!count($result)) { throw new Exception('Registro não encontrado.'); } $row = $this->formatTable($result[0]); return $row; }
public function getById($id = null) { if ($id) { $this->setId($id); } $arrCriteria = array('a.' . $this->getIdName() . ' = ?' => $this->getId()); $select = new Select($this->getTableName()); $select->addAllFields(); $select->where($arrCriteria); $this->onGetById($select); $result = $this->_dao->select($select); if (!count($result)) { throw new Exception('Registro não encontrado.'); } return $result[0]; }