ptut-vhost/build/database/core/PDOWrapper/PDOStatementWrapper.php

65 lines
1.1 KiB
PHP

<?php
/**
* Created by PhpStorm.
* User: lucas
* Date: 30/08/16
* Time: 17:42
*/
namespace database\core\PDOWrapper;
class PDOStatementWrapper extends \PDOStatement
{
/** @var String */
private $statement;
/** @var array */
private $parameters;
/** @var PDOWrapper */
private $connexion;
/**
* PDOStatementWrapper constructor.
* @param String $statement
* @param PDOWrapper $connexion
*/
public function __construct(String $statement, PDOWrapper $connexion)
{
$this->statement = $statement;
$this->connexion = $connexion;
}
/**
* @param array $input_parameters
* @return bool
*/
public function execute($input_parameters = []) : bool
{
$this->parameters = $input_parameters;
$this->connexion->stackStatement($this);
return true;
}
/**
* @return string
*/
public function getStatement() : String
{
return $this->statement;
}
/**
* @return array
*/
public function getParameters() : array
{
return $this->parameters;
}
}