protected function set_var($parameter) { if ($parameter === null) { return 'NULL'; } elseif (is_array($parameter)) { $nb_value = count($parameter); for ($i = 0; $i < $nb_value; $i++) { $parameter[$i] = '\'' . $this->querier->escape($parameter[$i]) . '\''; } return '(' . implode(', ', $parameter) . ')'; } elseif (is_string($parameter)) { return '\'' . $this->querier->escape($parameter) . '\''; } else { return $parameter; } }
public function __construct(DBConnection $connection, SQLQueryTranslator $translator) { parent::__construct($connection, $translator); $this->query_var_replacator = new SQLQueryVars($this); }