public function fetchRow($where = null, $order = null, $offset = null)
    {
        if (!($where instanceof Kwf_Db_Table_Select)) {
            $select = $this->select();

            if ($where !== null) {
                $this->_where($select, $where);
            }

            if ($order !== null) {
                $this->_order($select, $order);
            }

            $select->limit(1, ((is_numeric($offset)) ? (int) $offset : null));

        } else {
            $select = $where->limit(1, $where->getPart(Zend_Db_Select::LIMIT_OFFSET));
        }

        $rows = $this->_fetch($select);

        if (count($rows) == 0) {
            return null;
        }

        $data = array(
            'table'   => $this,
            'data'     => $rows[0],
            'stored'  => true
        );

        $rowClass = $this->_rowClass;
        return new $rowClass($data);
    }
public function fetchRow($where = null, $order = null, $offset = null)
    {
        if (!($where instanceof Kwf_Db_Table_Select)) {
            $select = $this->select();

            if ($where !== null) {
                $this->_where($select, $where);
            }

            if ($order !== null) {
                $this->_order($select, $order);
            }

            $select->limit(1, ((is_numeric($offset)) ? (int) $offset : null));

        } else {
            $select = $where->limit(1, $where->getPart(Zend_Db_Select::LIMIT_OFFSET));
        }

        $rows = $this->_fetch($select);

        if (count($rows) == 0) {
            return null;
        }

        $data = array(
            'table'   => $this,
            'data'     => $rows[0],
            'stored'  => true
        );

        $rowClass = $this->_rowClass;
        return new $rowClass($data);
    }
public function fetchRow ( $ where = null , $ order = null , $ offset = null ) { if ( ! ( $ where instanceof Kwf_Db_Table_Select ) ) { $ select = $ this -> select ( ) ; if ( $ where !== null ) { $ this -> _where ( $ select , $ where ) ; } if ( $ order !== null ) { $ this -> _order ( $ select , $ order ) ; } $ select -> limit ( 1 , ( ( is_numeric ( $ offset ) ) ? ( int ) $ offset : null ) ) ; } else { $ select = $ where -> limit ( 1 , $ where -> getPart ( Zend_Db_Select :: LIMIT_OFFSET ) ) ; } $ rows = $ this -> _fetch ( $ select ) ; if ( count ( $ rows ) == 0 ) { return null ; } $ data = array ( 'table' => $ this , 'data' => $ rows [ 0 ] , 'stored' => true ) ; $ rowClass = $ this -> _rowClass ; return new $ rowClass ( $ data ) ; }
Fetches one row in an object of type Kwf_Db_Table_Row,
or returns null if no row matches the specified criteria.

@param string|array|Kwf_Db_Table_Select $where  OPTIONAL An SQL WHERE clause or Kwf_Db_Table_Select object.
@param string|array                      $order  OPTIONAL An SQL ORDER clause.
@param int                               $offset OPTIONAL An SQL OFFSET value.
@return Kwf_Db_Table_Row|null The row results per the
Zend_Db_Adapter fetch mode, or null if no row found.
Fetches one row in an object of type Kwf_Db_Table_Row or returns null if no row matches the specified criteria .