Exponential 5.x Kernel 7.5.40 Exponential New Stack (Symfony-based) Kernel — PHP Class Reference

Public Member Functions | Protected Attributes | List of all members
eZ\Publish\Core\Persistence\Doctrine\SubselectDoctrineQuery Class Reference

Class SubselectDoctrineQuery. More...

Inheritance diagram for eZ\Publish\Core\Persistence\Doctrine\SubselectDoctrineQuery:

## Public Member Functions
| __construct (AbstractDoctrineQuery $outer)
| Constructs a new ezcQuerySubSelect object. More...
| bindParam (&$param, $placeHolder=null, $type=PDO::PARAM_STR)
| Binds the parameter $param to the specified variable name $placeHolder. More...
| bindValue ($value, $placeHolder=null, $type=PDO::PARAM_STR)
| Binds the value $value to the specified variable name $placeHolder. More...
| getQuery ()
| Returns the SQL string for the subselect. More...
| subSelect ()
| Returns ezcQuerySubSelect of deeper level. More...
Public Member Functions inherited from eZ\Publish\Core\Persistence\Doctrine\SelectDoctrineQuery
| select ()
| Opens the query and selects which columns you want to return with the query. More...
| alias ($name, $alias)
| Returns SQL to create an alias. More...
| selectDistinct ()
| Opens the query and uses a distinct select on the columns you want to return with the query. More...
| from ()
| Select which tables you want to select from. More...
| innerJoin ()
| Returns the SQL for an inner join or prepares $fromString for an inner join. More...
| leftJoin ()
| Returns the SQL for a left join or prepares $fromString for a left join. More...
| rightJoin ()
| Returns the SQL for a right join or prepares $fromString for a right join. More...
| where ()
| Adds a where clause with logical expressions to the query. More...
| limit ($limit, $offset='')
| Returns SQL that limits the result set. More...
| orderBy ($column, $type=self::ASC)
| Returns SQL that orders the result set by a given column. More...
| groupBy ()
| Returns SQL that groups the result set by a given column. More...
| having ()
| Returns SQL that set having by a given expression. More...
Public Member Functions inherited from eZ\Publish\Core\Persistence\Doctrine\AbstractDoctrineQuery
| __construct (Connection $connection)
| prepare ()
| __toString ()
| Return the SQL string for this query. More...
Public Member Functions inherited from eZ\Publish\Core\Persistence\Database\Query
| prepare ()
| __toString ()
| Return the SQL string for this query. More...

## Protected Attributes
| $outerQuery = null
Protected Attributes inherited from eZ\Publish\Core\Persistence\Doctrine\AbstractDoctrineQuery
| $connection

## Additional Inherited Members
Public Attributes inherited from eZ\Publish\Core\Persistence\Doctrine\SelectDoctrineQuery
| $permissionSubtreeJoinAdded = false
Public Attributes inherited from eZ\Publish\Core\Persistence\Doctrine\AbstractDoctrineQuery
| $expr
Public Attributes inherited from eZ\Publish\Core\Persistence\Database\SelectQuery
const | ASC = 'ASC'
const | DESC = 'DESC'
Protected Member Functions inherited from eZ\Publish\Core\Persistence\Doctrine\SelectDoctrineQuery
| doJoin ($type, array $args)
| Helper function to generate join. More...
Protected Member Functions inherited from eZ\Publish\Core\Persistence\Doctrine\AbstractDoctrineQuery
| parseArguments (array $args)
| Parse the arguments and validate for existance of values. More...

## Detailed Description

Class SubselectDoctrineQuery.

Deprecated:
  Since 6.13, please use Doctrine DBAL instead (@ezpublish.persistence.connection) it provides richer and more powerful DB abstraction which is also easier to use.

Definition at line 17 of file SubselectDoctrineQuery.php.

## Constructor & Destructor Documentation

## ◆ __construct()

eZ\Publish\Core\Persistence\Doctrine\SubselectDoctrineQuery::__construct | ( | AbstractDoctrineQuery | $outer | ) |

Constructs a new ezcQuerySubSelect object.

The subSelect() method of the ezcQuery object creates an object of this class, and passes itself as $outer parameter to this constructor.

Parameters

  \eZ\Publish\Core\Persistence\Doctrine\AbstractDoctrineQuery | $outer |

Definition at line 34 of file SubselectDoctrineQuery.php.

## Member Function Documentation

## ◆ bindParam()

eZ\Publish\Core\Persistence\Doctrine\SubselectDoctrineQuery::bindParam | ( | & | $param,
|  |  | $placeHolder = `null`,
|  |  | $type = `PDO::PARAM_STR`
| ) |  |

Binds the parameter $param to the specified variable name $placeHolder.

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: `<?php $value = 2; $subSelect = $q->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()

Parameters

  | &mixed | $param
  string | $placeHolder | the name to bind with. The string must start with a colon ':'.

Returns
  string the placeholder name used.

Reimplemented from eZ\Publish\Core\Persistence\Doctrine\AbstractDoctrineQuery.

Definition at line 82 of file SubselectDoctrineQuery.php.

## ◆ bindValue()

eZ\Publish\Core\Persistence\Doctrine\SubselectDoctrineQuery::bindValue | ( |  | $value,
|  |  | $placeHolder = `null`,
|  |  | $type = `PDO::PARAM_STR`
| ) |  |

Binds the value $value to the specified variable name $placeHolder.

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 $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.

Example: `<?php $value = 2; $subSelect = $q->subSelect(); $subSelect->select( name ) ->from( 'table2' ) ->where( $subSelect->expr->in( 'id', $subSelect->bindValue( $value ) ) );`

`$q->select( '*' ) ->from( 'table1' ) ->where ( $q->expr->eq( 'name', $subSelect ) );`

`$stmt = $q->prepare(); // the $value is bound to the query. $value = 4; $stmt->execute(); // subselect executed with 'id = 2' ?>`

See also
  ezcQuery::bindValue()

Parameters

  mixed | $value |
  string | $placeHolder | the name to bind with. The string must start with a colon ':'.

Returns
  string the placeholder name used.

Reimplemented from eZ\Publish\Core\Persistence\Doctrine\AbstractDoctrineQuery.

Definition at line 128 of file SubselectDoctrineQuery.php.

## ◆ getQuery()

eZ\Publish\Core\Persistence\Doctrine\SubselectDoctrineQuery::getQuery | ( |  | ) |

Returns the SQL string for the subselect.

Example: `<?php $subSelect = $q->subSelect(); $subSelect->select( name )->from( 'table2' ); $q->select( '*' ) ->from( 'table1' ) ->where ( $q->expr->eq( 'name', $subSelect ) ); $stmt = $q->prepare(); $stmt->execute(); ?>`

Returns
  string

Reimplemented from eZ\Publish\Core\Persistence\Doctrine\SelectDoctrineQuery.

Definition at line 151 of file SubselectDoctrineQuery.php.

Referenced by eZ\Publish\Core\Persistence\Doctrine\DoctrineExpression\in().

## ◆ subSelect()

eZ\Publish\Core\Persistence\Doctrine\SubselectDoctrineQuery::subSelect | ( |  | ) |

Returns ezcQuerySubSelect of deeper level.

Used for making subselects inside subselects.

Example: `<?php $value = 2; $subSelect = $q->subSelect(); $subSelect->select( name ) ->from( 'table2' ) ->where( $subSelect->expr->in( 'id', $subSelect->bindValue( $value ) ) );`

`$q->select( '*' ) ->from( 'table1' ) ->where ( $q->expr->eq( 'name', $subSelect ) );`

`$stmt = $q->prepare(); // the $value is bound to the query. $value = 4; $stmt->execute(); // subselect executed with 'id = 2' ?>`

Returns
  \eZ\Publish\Core\Persistence\Database\SelectQuery

Reimplemented from eZ\Publish\Core\Persistence\Doctrine\AbstractDoctrineQuery.

Definition at line 185 of file SubselectDoctrineQuery.php.

References eZ\Publish\Core\Persistence\Doctrine\SubselectDoctrineQuery\$outerQuery.

## Member Data Documentation

## ◆ $outerQuery

eZ\Publish\Core\Persistence\Doctrine\SubselectDoctrineQuery::$outerQuery = null
| protected

Definition at line 24 of file SubselectDoctrineQuery.php.

Referenced by eZ\Publish\Core\Persistence\Doctrine\SubselectDoctrineQuery\subSelect().

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

- SubselectDoctrineQuery.php

Copyright © 1998 – 2026 7x. All rights reserved. Licensed under the GNU GPLv2+.