/** * Find the first record that is retrieved by the given sql * * @see Mad_Model_Base::findBySql() * @param string $sql * @param array $bindVars */ protected function _findInitialBySql($sql, $bindVars) { $sql = $this->sanitizeSql($sql, $bindVars); $sql = $this->connection->addLimitOffset($sql, array('limit' => 1, 'offset' => 0)); if ($row = $this->connection->selectOne($sql, "{$this->_className} Load")) { return $this->instantiate($row); } else { return null; } }