lithium\data\source\database\adapter\Sqlite3::_execute()
Implements
lithium\data\source\Database::_execute()
Execute a given query.
Parameters
-
string
$sql
The sql string to execute
-
array
$options
No available options.
Returns
\lithium\data\source\ResultReturns a result object if the query was successful.
Filter
This method can be filtered.
Source
protected function _execute($sql, array $options = array()) {
$conn = $this->connection;
$params = compact('sql', 'options');
return $this->_filter(__METHOD__, $params, function($self, $params) use ($conn) {
$sql = $params['sql'];
try {
$resource = $conn->query($sql);
} catch (PDOException $e) {
$self->invokeMethod('_error', array($sql));
};
return $self->invokeMethod('_instance', array('result', compact('resource')));
});
}