/** * Prepares a sql statement to be executed * * @param \CoreTyson\Database\Query $query The query to convert into a statement. * @return \CoreTyson\Database\Statement\AbstractStatement */ public function prepare($query) : AbstractStatement { if (!$this->isConnected()) { $this->connect(); } $isObject = $query instanceof Query; $statement = $this->_PdoConnection->prepare($isObject ? $query->sql() : $query); return new PdoStatement($statement, $this); }