connection; } /** * Escape string value * * @param string $value Value to escape * * @return string * * @since 1.0.0 */ public function quote(string $value) : string { return $this->connection->con->quote($value); } /** * Bind parameter. * * @param array $binds Binds * @param ?string $key Key * * @return Builder * * @since 1.0.0 */ public function bind(array $binds, ?string $key = null) : self { if ($key === null) { $this->binds[] = $binds; } else { $this->binds[$key] = $binds; } return $this; } /** * Get query type. * * @return int * * @since 1.0.0 */ public function getType() : int { return $this->type; } /** * Parsing to sql string. * * @return string * * @since 1.0.0 */ abstract public function toSql() : string; /** * Execute query. * * @return ?\PDOStatement * * @since 1.0.0 */ abstract public function execute() : ?\PDOStatement; /** * Get bind parameter type. * * @param mixed $value Value to bind * * @return int * * @throws \Exception * * @since 1.0.0 */ public static function getBindParamType(mixed $value) : int { if (\is_int($value)) { return \PDO::PARAM_INT; } elseif (\is_string($value) || \is_float($value)) { return \PDO::PARAM_STR; } throw new \Exception(); } }