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

65 lines
1.1 KiB
PHP
Raw Normal View History

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