PHP Interface eZ\Publish\Core\Persistence\Database\Query

Show file Open project: ezsystems/ezpublish-kernel Interface Usage Examples

Public Methods

Method Description
__toString ( ) : string Return the SQL string for this query.
bindParam ( &mixed &$param, string $placeHolder = null, $type = PDO::PARAM_STR ) : string Binds the parameter $param to the specified variable name $placeHolder.
bindValue ( mixed $value, string $placeHolder = null, $type = PDO::PARAM_STR ) : string Binds the value $value to the specified variable name $placeHolder.
getQuery ( ) : string Return the SQL string for this query.
prepare ( ) : PDOStatement
subSelect ( ) : eZ\Publish\Core\Persistence\Database\SelectQuery Create a subselect used with the current query.

Method Details

__toString() public method

Return the SQL string for this query.
public __toString ( ) : string
return string

bindParam() public method

. This method provides a shortcut for PDOStatement::bindParam when using prepared statements. The parameter $param specifies the variable that you want to bind. If $placeholder is not provided bind() will automatically create a placeholder for you. An automatic placeholder will be of the name 'placeholder1', 'placeholder2' etc. For more information see {@link http://php.net/pdostatement-bindparam} Example: $value = 2; $q->eq( 'id', $q->bindParam( $value ) ); $stmt = $q->prepare(); // the parameter $value is bound to the query. $value = 4; $stmt->execute(); // executed with 'id = 4'
public bindParam ( &mixed &$param, string $placeHolder = null, $type = PDO::PARAM_STR ) : string
$param &mixed
$placeHolder string the name to bind with. The string must start with a colon ':'.
return string the placeholder name used.

bindValue() public method

This method provides a shortcut for PDOStatement::bindValue when using prepared statements. The parameter $value specifies the value that you want to bind. If $placeholder is not provided bindValue() will automatically create a placeholder for you. An automatic placeholder will be of the name 'placeholder1', 'placeholder2' etc. For more information see {@link http://php.net/pdostatement-bindparam} Example: $value = 2; $q->eq( 'id', $q->bindValue( $value ) ); $stmt = $q->prepare(); // the value 2 is bound to the query. $value = 4; $stmt->execute(); // executed with 'id = 2'
public bindValue ( mixed $value, string $placeHolder = null, $type = PDO::PARAM_STR ) : string
$value mixed
$placeHolder string the name to bind with. The string must start with a colon ':'.
return string the placeholder name used.

getQuery() public method

Return the SQL string for this query.
public getQuery ( ) : string
return string

prepare() public method

public prepare ( ) : PDOStatement
return PDOStatement

subSelect() public method

Create a subselect used with the current query.
public subSelect ( ) : eZ\Publish\Core\Persistence\Database\SelectQuery
return eZ\Publish\Core\Persistence\Database\SelectQuery