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;
    }