public function mapCriteriaToExistingSelect(
        ICriteria $criteria,
        Select $select,
        string $tableAlias,
        array &$memberMappings = null,
        array $extraRequiredMembers = []
    ) {
        $subclassTableAliases = [];
        $condition            = null;
        $loaded               = false;

        if ($criteria->hasCondition()) {
            $condition = $this->applySpecificInstanceOfCondition(
                $criteria->getCondition(),
                $select,
                /* out */
                $loaded,
                $subclassTableAliases
            );
        }

        if (!$loaded) {
            $this->mapper->getMapping()->addLoadToSelect($select, $tableAlias, /* out */ $subclassTableAliases);
        }

        $memberMappings = $this->mapAllRequiredMembersFor($criteria, $tableAlias, $subclassTableAliases, $extraRequiredMembers);
        $memberMappings = $this->optimizeOneToOneRelationsAsLeftJoins($select, $memberMappings);

        if ($condition) {
            $select->where($this->mapCondition($condition, $select, $memberMappings));
        }

        foreach ($criteria->getOrderings() as $ordering) {
            $this->mapOrdering($ordering, $select, $memberMappings);
        }

        $select->offset($criteria->getStartOffset())
            ->limit($criteria->getLimitAmount());

        return $select;
    }
public function mapCriteriaToExistingSelect(
        ICriteria $criteria,
        Select $select,
        string $tableAlias,
        array &$memberMappings = null,
        array $extraRequiredMembers = []
    ) {
        $subclassTableAliases = [];
        $condition            = null;
        $loaded               = false;

        if ($criteria->hasCondition()) {
            $condition = $this->applySpecificInstanceOfCondition(
                $criteria->getCondition(),
                $select,
                /* out */
                $loaded,
                $subclassTableAliases
            );
        }

        if (!$loaded) {
            $this->mapper->getMapping()->addLoadToSelect($select, $tableAlias, /* out */ $subclassTableAliases);
        }

        $memberMappings = $this->mapAllRequiredMembersFor($criteria, $tableAlias, $subclassTableAliases, $extraRequiredMembers);
        $memberMappings = $this->optimizeOneToOneRelationsAsLeftJoins($select, $memberMappings);

        if ($condition) {
            $select->where($this->mapCondition($condition, $select, $memberMappings));
        }

        foreach ($criteria->getOrderings() as $ordering) {
            $this->mapOrdering($ordering, $select, $memberMappings);
        }

        $select->offset($criteria->getStartOffset())
            ->limit($criteria->getLimitAmount());

        return $select;
    }
public function mapCriteriaToExistingSelect ( ICriteria $ criteria , Select $ select , string $ tableAlias , array & $ memberMappings = null , array $ extraRequiredMembers = [ ] ) { $ subclassTableAliases = [ ] ; $ condition = null ; $ loaded = false ; if ( $ criteria -> hasCondition ( ) ) { $ condition = $ this -> applySpecificInstanceOfCondition ( $ criteria -> getCondition ( ) , $ select , /* out */ $ loaded , $ subclassTableAliases ) ; } if ( ! $ loaded ) { $ this -> mapper -> getMapping ( ) -> addLoadToSelect ( $ select , $ tableAlias , /* out */ $ subclassTableAliases ) ; } $ memberMappings = $ this -> mapAllRequiredMembersFor ( $ criteria , $ tableAlias , $ subclassTableAliases , $ extraRequiredMembers ) ; $ memberMappings = $ this -> optimizeOneToOneRelationsAsLeftJoins ( $ select , $ memberMappings ) ; if ( $ condition ) { $ select -> where ( $ this -> mapCondition ( $ condition , $ select , $ memberMappings ) ) ; } foreach ( $ criteria -> getOrderings ( ) as $ ordering ) { $ this -> mapOrdering ( $ ordering , $ select , $ memberMappings ) ; } $ select -> offset ( $ criteria -> getStartOffset ( ) ) -> limit ( $ criteria -> getLimitAmount ( ) ) ; return $ select ; }
Maps the supplied criteria to an existing select query for the entity.

@param ICriteria $criteria
@param Select    $select
@param string    $tableAlias
@param array     $memberMappings
@param array     $extraRequiredMembers

@return mixed
@throws InvalidArgumentException
Maps the supplied criteria to an existing select query for the entity .