eZ\Publish\Core\Persistence\Doctrine\SubselectDoctrineQuery::bindParam PHP Method

bindParam() public method

This method uses ezcQuery::bindParam() from the ezcQuery class in which the subSelect was called. Info about bound parameters are stored in the parent ezcQuery object that is stored in the $outer property. 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. Example: subSelect(); $subSelect->select('*') ->from( 'table2' ) ->where( $subSelect->expr->in( 'id', $subSelect->bindParam( $value ) ) ); $q->select( '*' ) ->from( 'table' ) ->where ( $q->expr->eq( 'id', $subSelect ) ); $stmt = $q->prepare(); // the parameter $value is bound to the query. $value = 4; $stmt->execute(); // subselect executed with 'id = 4' ?>
See also: ezcQuery::bindParam()
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.
    public function bindParam(&$param, $placeHolder = null, $type = PDO::PARAM_STR)
    {
        return $this->outerQuery->bindParam($param, $placeHolder, $type);
    }