Will bypass any formatters and casting - effectively forcing the engine "to keep its
hands off" - when $value is an object with the property scalar (created by casting
a scalar value to an object i.e. (object) 'foo'). This feature allows to construct
values or queries that are not (yet) supported by the engine.
public function value($value, array $schema = array()) { if (($result = parent::value($value, $schema)) !== null) { return $result; } return "'{$value}'"; }
/** * Converts a given value into the proper type based on a given schema definition. * * @see lithium\data\source\Database::schema() * @param mixed $value The value to be converted. Arrays will be recursively converted. * @param array $schema Formatted array from `lithium\data\source\Database::schema()` * @return mixed Value with converted type. */ public function value($value, array $schema = array()) { if (($result = parent::value($value, $schema)) !== null) { return $result; } return $this->connection->quote((string) $value); }
/** * Converts a given value into the proper type based on a given schema definition. * * @link http://www.sqlite.org/lang_keywords.html * @see lithium\data\source\Database::schema() * @param mixed $value The value to be converted. Arrays will be recursively converted. * @param array $schema Formatted array from `lithium\data\source\Database::schema()` * @return mixed Value with converted type. */ public function value($value, array $schema = array()) { if (is_array($value)) { return parent::value($value, $schema); } return "'" . $this->connection->escapeString($value) . "'"; }
/** * Converts a given value into the proper type based on a given schema definition. * * @see lithium\data\source\Database::schema() * @param mixed $value The value to be converted. Arrays will be recursively converted. * @param array $schema Formatted array from `lithium\data\source\Database::schema()` * @return mixed Value with converted type. */ public function value($value, array $schema = array()) { if (($result = parent::value($value, $schema)) !== null) { return $result; } return "'" . mysql_real_escape_string((string) $value, $this->connection) . "'"; }
public function value($value, array $schema = array()) { if (is_array($value)) { return parent::value($value, $schema); } return $value; }