eZ\Bundle\EzPublishMigrationBundle\Command\LegacyStorage\UpdateFieldAlwaysAvailableFlagCommand::initSelectQuery PHP Метод

initSelectQuery() защищенный Метод

Initializes main selection $query.
protected initSelectQuery ( eZ\Publish\Core\Persistence\Database\SelectQuery $query )
$query eZ\Publish\Core\Persistence\Database\SelectQuery
    protected function initSelectQuery(SelectQuery $query)
    {
        /** @var \eZ\Publish\Core\Persistence\Database\DatabaseHandler $databaseHandler */
        $databaseHandler = $this->getContainer()->get('ezpublish.connection');
        $query->select($databaseHandler->quoteColumn('id', 'ezcontentobject'), $databaseHandler->quoteColumn('current_version', 'ezcontentobject'), $databaseHandler->quoteColumn('initial_language_id', 'ezcontentobject'), $query->expr->count('distinct ezcontentobject_attribute.language_code'))->from('ezcontentobject')->innerJoin($databaseHandler->quoteTable('ezcontentobject_attribute'), $query->expr->lAnd($query->expr->eq($databaseHandler->quoteColumn('id', 'ezcontentobject'), $databaseHandler->quoteColumn('contentobject_id', 'ezcontentobject_attribute')), $query->expr->eq($databaseHandler->quoteColumn('current_version', 'ezcontentobject'), $databaseHandler->quoteColumn('version', 'ezcontentobject_attribute')), $query->expr->gt($query->expr->bitAnd($databaseHandler->quoteColumn('language_id', 'ezcontentobject_attribute'), $query->bindValue(1, null, PDO::PARAM_INT)), $query->bindValue(0, null, PDO::PARAM_INT))))->where($query->expr->lAnd($query->expr->gt($query->expr->bitAnd($databaseHandler->quoteColumn('language_mask', 'ezcontentobject'), $query->bindValue(1, null, PDO::PARAM_INT)), $query->bindValue(0, null, PDO::PARAM_INT)), $query->expr->neq($query->expr->bitAnd($query->expr->bitAnd($databaseHandler->quoteColumn('language_mask', 'ezcontentobject'), $query->bindValue(-2, null, PDO::PARAM_INT)), $query->expr->sub($query->expr->bitAnd($databaseHandler->quoteColumn('language_mask', 'ezcontentobject'), $query->bindValue(-2, null, PDO::PARAM_INT)), $query->bindValue(1, null, PDO::PARAM_INT))), $query->bindValue(0, null, PDO::PARAM_INT))))->groupBy($databaseHandler->quoteColumn('id', 'ezcontentobject'))->having($query->expr->gt($query->expr->count('distinct ezcontentobject_attribute.language_code'), $query->bindValue(1, null, PDO::PARAM_INT)));
    }