public function sqlValue($mixed) { if (is_object($mixed) && method_exists($mixed, 'toSql')) { return $mixed->toSql($this); } return $this->quote($this->escape($mixed)); }