/** * @param Cond $cond * * @return array * @throws \Model\Db\Exception\ErrorException * @throws \Model\Exception\ErrorException */ public function fetchPairs(Cond $cond = null) { $entity = $cond->getEntityName() ? $cond->getEntityName() : $this->getRawName(); $select = $this->prepareSelect($cond->limit(1), $entity); if ($cond->checkCond(Cond::SHOW_QUERY) || $cond->checkCond(Cond::SHOW_QUERY_EXTENDED)) { echo '<!--' . $select . "-->\n"; } $item = $this->db->fetchPairs($select->__toString(), $select->getBind()); return $item; }