Hoa central
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
Hoa\Database\DalStatement Class Reference

Public Member Functions

 __construct (IDal\WrapperStatement $statement)
 
 execute (Array $bindParameters=[])
 
 bindParameter ($parameter, &$value, $type=null, $length=null)
 
 fetchAll ()
 
 fetchFirst ()
 
 fetchLast ()
 
 fetchNext ()
 
 fetchPrior ()
 
 fetchColumn ($column=0)
 
 closeCursor ()
 
 errorCode ()
 
 errorInfo ()
 

Protected Member Functions

 setStatement (IDal\WrapperStatement $statement)
 
 getStatement ()
 

Protected Attributes

 $statement = null
 

Detailed Description

Class .

The higher class that represents a DAL statement.

Definition at line 47 of file DalStatement.php.

Constructor & Destructor Documentation

Hoa\Database\DalStatement::__construct ( IDal\WrapperStatement  $statement)

Create a statement instance.

Parameters
\Hoa\Database\IDal\WrapperStatement$statementThe statement instance.
Returns
void

Definition at line 66 of file DalStatement.php.

67  {
68  $this->setStatement($statement);
69  }
setStatement(IDal\WrapperStatement $statement)

Here is the call graph for this function:

Member Function Documentation

Hoa\Database\DalStatement::bindParameter (   $parameter,
$value,
  $type = null,
  $length = null 
)

Bind a parameter to te specified variable name.

Parameters
mixed$parameterParameter name.
mixed$valueParameter value.
int$typeType of value.
int$lengthLength of data type.
Returns
bool
Exceptions

Definition at line 126 of file DalStatement.php.

131  {
132  if (null === $type) {
133  return $this->getStatement()->bindParameter($parameter, $value);
134  }
135 
136  if (null === $length) {
137  return $this->getStatement()->bindParameter(
138  $parameter,
139  $value,
140  $type
141  );
142  }
143 
144  return $this->getStatement()->bindParameter(
145  $parameter,
146  $value,
147  $type,
148  $length
149  );
150  }

Here is the call graph for this function:

Hoa\Database\DalStatement::closeCursor ( )

Close the cursor, enabling the statement to be executed again.

Returns
bool
Exceptions

Definition at line 226 of file DalStatement.php.

227  {
228  return $this->getStatement()->closeCursor();
229  }

Here is the call graph for this function:

Hoa\Database\DalStatement::errorCode ( )

Fetch the SQLSTATE associated with the last operation on the statement handle.

Returns
string
Exceptions

Definition at line 238 of file DalStatement.php.

239  {
240  return $this->getStatement()->errorCode();
241  }

Here is the call graph for this function:

Hoa\Database\DalStatement::errorInfo ( )

Fetch extends error information associated with the last operation on the statement handle.

Returns
array
Exceptions

Definition at line 250 of file DalStatement.php.

251  {
252  return $this->getStatement()->errorInfo();
253  }

Here is the call graph for this function:

Hoa\Database\DalStatement::execute ( Array  $bindParameters = [])

Execute a prepared statement.

Parameters
array$bindParametersBind parameters values if bindParam is not called.
Returns
Exceptions

Definition at line 105 of file DalStatement.php.

106  {
107  if (empty($bindParameters)) {
108  return $this->getStatement()->execute();
109  }
110 
111  $this->getStatement()->execute($bindParameters);
112 
113  return $this;
114  }

Here is the call graph for this function:

Hoa\Database\DalStatement::fetchAll ( )

Return an array containing all of the result set rows.

Returns
array
Exceptions

Definition at line 158 of file DalStatement.php.

159  {
160  return $this->getStatement()->fetchAll();
161  }

Here is the call graph for this function:

Hoa\Database\DalStatement::fetchColumn (   $column = 0)

Return a single column from the next row of the result set or false if there is no more row.

Parameters
int$columnColumn index.
Returns
mixed
Exceptions

Definition at line 215 of file DalStatement.php.

216  {
217  return $this->getStatement()->fetchColumn($column);
218  }

Here is the call graph for this function:

Hoa\Database\DalStatement::fetchFirst ( )

Fetch the first row in the result set.

Returns
mixed
Exceptions

Definition at line 169 of file DalStatement.php.

170  {
171  return $this->getStatement()->fetchFirst();
172  }

Here is the call graph for this function:

Hoa\Database\DalStatement::fetchLast ( )

Fetch the last row in the result set.

Returns
mixed
Exceptions

Definition at line 180 of file DalStatement.php.

181  {
182  return $this->getStatement()->fetchLast();
183  }

Here is the call graph for this function:

Hoa\Database\DalStatement::fetchNext ( )

Fetch the next row in the result set.

Returns
mixed
Exceptions

Definition at line 191 of file DalStatement.php.

192  {
193  return $this->getStatement()->fetchNext();
194  }

Here is the call graph for this function:

Hoa\Database\DalStatement::fetchPrior ( )

Fetch the previous row in the result set.

Returns
mixed
Exceptions

Definition at line 202 of file DalStatement.php.

203  {
204  return $this->getStatement()->fetchPrior();
205  }

Here is the call graph for this function:

Hoa\Database\DalStatement::getStatement ( )
protected

Get the statement instance.

Returns

Definition at line 92 of file DalStatement.php.

93  {
94  return $this->statement;
95  }

Here is the caller graph for this function:

Hoa\Database\DalStatement::setStatement ( IDal\WrapperStatement  $statement)
protected

Set the statement instance.

Parameters
\Hoa\Database\IDal\WrapperStatement$statementThe statement instance.
Returns

Definition at line 79 of file DalStatement.php.

80  {
81  $old = $this->statement;
82  $this->statement = $statement;
83 
84  return $old;
85  }

Here is the caller graph for this function:

Member Data Documentation

Hoa\Database\DalStatement::$statement = null
protected

Definition at line 54 of file DalStatement.php.


The documentation for this class was generated from the following file: