示例#1
0
 public function fetchRow(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->fetchRow($select->__toString(), $select->getBind());
     if (!$cond->getCond(Cond::WITHOUT_PREPARE, false)) {
         $item = call_user_func_array(array($this, 'prepare'), array($item, $cond));
     }
     return $item;
 }