Goes through each alias for the operation to get results only for that specific type, then combine and return
them all.

@param string $hydratorType
@return array|LdapObjectCollection|mixed
761943
protected function getResultsForAliases($hydratorType)
    {
        /** @var LdapObjectCollection|array $results */
        $results = [];

        foreach ($this->operation->getFilter()->getAliases() as $alias => $schema) {
            $operation = clone $this->operation;

            /**
             * If we received the partial limit of results, re-adjust the next operations limit so we don't go over.
             *
             * @todo This is getting difficult due to multiple operations needed to select all schema types. If this was
             *       a single operation the issue would not exist. But with a single query and multiple types I cannot
             *       easily determine which result is what type. Unsure of the best way to fix this at the moment.
             */
            if ($operation->getSizeLimit() && count($results) < $operation->getSizeLimit()) {
                $operation->setSizeLimit($operation->getSizeLimit() - count($results));
            }

            $objects = $this->getResultsFromLdap($operation, $hydratorType, $schema, $alias);
            if ($objects instanceof LdapObjectCollection && $results) {
                $results->add(...$objects->toArray());
            } elseif ($objects instanceof LdapObjectCollection) {
                $results = $objects;
            } else {
                $results = array_merge($results, $objects);
            }

            // If the results have reached the expected size limit then end the loop.
            if ($this->operation->getSizeLimit() && count($results) == $operation->getSizeLimit()) {
                break;
            }
        }

        return $results;
    }
818199
private function getOperation(string $method, string $className): stdClass
    {
        foreach ($this->getOperations($className) as $operation) {
            if ($operation->{'hydra:method'} === $method) {
                return $operation;
            }
        }

        throw new \InvalidArgumentException(sprintf('Operation "%s" of class "%s" doesn\'t exist.', $method, $className));
    }
621624
public function hydrateCommands(array $commands): array
    {
        if ($this->commandFinder->isDir()) {
            $commands = array_merge($commands, $this->getCommandsFromFinder());
        }

        return $commands;
    }
998635
public function all()
	{
		$results = $this->fetchAll(false, PDO::FETCH_ASSOC);

		if(!empty($results))
		{
			$results = $this->hydrateModelsAndLoadIncludes($results);
		}

		return $this->createResultSet($results);
	}
1122305
public function getByType($sType)
    {
        $aEvents = $this->getAll([
            'where' => [
                [$this->sTableAlias . '.type', $sType],
            ],
        ]);

        if (!$aEvents) {
            return false;
        }

        return $aEvents[0];
    }
83337
private function getHydraOperation(string $resourceClass, ResourceMetadata $resourceMetadata, string $operationName, array $operation, string $prefixedShortName, string $operationType, SubresourceMetadata $subresourceMetadata = null): array
    {
        if (OperationType::COLLECTION === $operationType) {
            $method = $this->operationMethodResolver->getCollectionOperationMethod($resourceClass, $operationName);
        } elseif (OperationType::ITEM === $operationType) {
            $method = $this->operationMethodResolver->getItemOperationMethod($resourceClass, $operationName);
        } else {
            $method = 'GET';
        }

        $hydraOperation = $operation['hydra_context'] ?? [];
        if ($resourceMetadata->getTypedOperationAttribute($operationType, $operationName, 'deprecation_reason', null, true)) {
            $hydraOperation['owl:deprecated'] = true;
        }

        $shortName = $resourceMetadata->getShortName();
        $inputMetadata = $resourceMetadata->getTypedOperationAttribute($operationType, $operationName, 'input', ['class' => false]);
        $inputClass = \array_key_exists('class', $inputMetadata) ? $inputMetadata['class'] : false;
        $outputMetadata = $resourceMetadata->getTypedOperationAttribute($operationType, $operationName, 'output', ['class' => false]);
        $outputClass = \array_key_exists('class', $outputMetadata) ? $outputMetadata['class'] : false;

        if ('GET' === $method && OperationType::COLLECTION === $operationType) {
            $hydraOperation += [
                '@type' => ['hydra:Operation', 'schema:FindAction'],
                'hydra:title' => "Retrieves the collection of $shortName resources.",
                'returns' => 'hydra:Collection',
            ];
        } elseif ('GET' === $method && OperationType::SUBRESOURCE === $operationType) {
            $hydraOperation += [
                '@type' => ['hydra:Operation', 'schema:FindAction'],
                'hydra:title' => $subresourceMetadata && $subresourceMetadata->isCollection() ? "Retrieves the collection of $shortName resources." : "Retrieves a $shortName resource.",
                'returns' => null === $outputClass ? 'owl:Nothing' : "#$shortName",
            ];
        } elseif ('GET' === $method) {
            $hydraOperation += [
                '@type' => ['hydra:Operation', 'schema:FindAction'],
                'hydra:title' => "Retrieves $shortName resource.",
                'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName,
            ];
        } elseif ('PATCH' === $method) {
            $hydraOperation += [
                '@type' => 'hydra:Operation',
                'hydra:title' => "Updates the $shortName resource.",
                'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName,
                'expects' => null === $inputClass ? 'owl:Nothing' : $prefixedShortName,
            ];
        } elseif ('POST' === $method) {
            $hydraOperation += [
                '@type' => ['hydra:Operation', 'schema:CreateAction'],
                'hydra:title' => "Creates a $shortName resource.",
                'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName,
                'expects' => null === $inputClass ? 'owl:Nothing' : $prefixedShortName,
            ];
        } elseif ('PUT' === $method) {
            $hydraOperation += [
                '@type' => ['hydra:Operation', 'schema:ReplaceAction'],
                'hydra:title' => "Replaces the $shortName resource.",
                'returns' => null === $outputClass ? 'owl:Nothing' : $prefixedShortName,
                'expects' => null === $inputClass ? 'owl:Nothing' : $prefixedShortName,
            ];
        } elseif ('DELETE' === $method) {
            $hydraOperation += [
                '@type' => ['hydra:Operation', 'schema:DeleteAction'],
                'hydra:title' => "Deletes the $shortName resource.",
                'returns' => 'owl:Nothing',
            ];
        }

        $hydraOperation['hydra:method'] ?? $hydraOperation['hydra:method'] = $method;

        if (!isset($hydraOperation['rdfs:label']) && isset($hydraOperation['hydra:title'])) {
            $hydraOperation['rdfs:label'] = $hydraOperation['hydra:title'];
        }

        ksort($hydraOperation);

        return $hydraOperation;
    }
1130081
public function get()
    {
        switch ($this->type) {
            case LDAP_MODIFY_BATCH_REMOVE_ALL:
                // A values key cannot be provided when
                // a remove all type is selected.
                return [
                    static::KEY_ATTRIB => $this->attribute,
                    static::KEY_MODTYPE => $this->type
                ];
            case LDAP_MODIFY_BATCH_REMOVE:
                // Fallthrough.
            case LDAP_MODIFY_BATCH_ADD:
                // Fallthrough.
            case LDAP_MODIFY_BATCH_REPLACE:
                return [
                    static::KEY_ATTRIB => $this->attribute,
                    static::KEY_MODTYPE => $this->type,
                    static::KEY_VALUES => $this->values,
                ];
            default:
                // If the modtype isn't recognized, we'll return null.
                return;
        }
    }
940029
protected function getResultsByType($type)
    {
        $mapper = $this->relatedMapper->getManager()->mapper($type);

        $key = $mapper->getEntityMap()->getKeyName();

        $query = $mapper->getQuery();

        return $query->whereIn($key, array_keys($this->dictionary[$type]))->get();
    }
202239
public function fetchAll($returnType = Table::RETURN_MODEL) {
        $return = $this->select(array(), $returnType);
        if (is_a($return, 'DBScribe\Table')) $return = $return->execute();
        if (is_bool($return)) return new ArrayCollection();

        return $return;
    }
422156
protected function hydrateModelsAndLoadIncludes($results)
	{
		$hydrated = [];

		foreach($results as $result)
		{
			$hydrated[] = $this->hydrateModel($result);
		}

		$this->loadIncludes($hydrated);

		return $hydrated;
	}
717287
public function extract($objectClass, $result)
    {
        $hydrator = $this->objectManager->getHydratorFor($objectClass);

        return $hydrator->extract($result);
    }
465479
public function aliases()
    {
        return collect($this->getManifest())->flatMap(function ($configuration) {
            return (array) ($configuration['aliases'] ? $configuration['aliases'] : []);
        })->filter()->all();
    }
1289488
private static function getHydratorClosure($object)
    {
        if (!isset(self::$hydratorClosure)) {
            self::$hydratorClosure = function($object, array $data) {
                foreach ($data as $name => $value) {
                    $object->$name = $value;
                }
            };
        }

        $class = get_class($object);

        if (!isset(self::$hydratorClosureCache[$class])) {
            self::$hydratorClosureCache[$class] = \Closure::bind(self::$hydratorClosure, null, $class);
        }

        return self::$hydratorClosureCache[$class];
    }
863618
public function getKinesisClient($type)
    {

        if (!empty($this->clients[$type])) {
            return $this->clients[$type];
        }

        $config = [
            'version' => $this->config['api_version'],
            'region' => $this->config['region'],
        ];

        $config['credentials'] = [
            'key' => $this->config[$type]['key'],
            'secret' => $this->config[$type]['secret'],
        ];

        $sdk = new Sdk();
        $this->clients[$type] = $sdk->createKinesis($config);

        return $this->clients[$type];
    }
1148245
public function execute($hydrationMode = self::RESULT_TYPE_HYDRATED)
    {
        if ($hydrationMode !== self::RESULT_TYPE_NONE) {
            $items = $this->getResultIterator();
        }

        // Send requests until the queue is empty
        while (!empty($this->queue)) {
            $pool = new \Aws\CommandPool($this->dm->getClient(), $this->getQueue(), [
                'concurrency'            => $this->poolSize,
                'fulfilled'              => $this->getFulfilledCallback($items, $hydrationMode),
                'rejected'               => $this->getRejectedCallback(),
                'preserve_iterator_keys' => true
            ]);

            $pool->promise()->wait();

            if ($this->isPaging()) {
                break;
            }
        }

        if ($hydrationMode === self::RESULT_TYPE_NONE) {
            return true;
        } elseif ($hydrationMode === self::RESULT_TYPE_SDK) {
            return new SdkResultIterator($items);
        }

        return new IteratorIterator($items);
    }
693432
public function findAll($alias = null, $select = array(), $hydrationMode = null)
    {
        if (!$alias) {
            $alias = 'x';
        }

        if (!$hydrationMode) {
            $hydrationMode = Query::HYDRATE_OBJECT;
        }

        return $this->_prepareSelect($alias, $select)
            ->getQuery()
            ->getResult($hydrationMode)
        ;
    }
357301
public function getDomainForType($propelType)
    {
        if (!isset($this->schemaDomainMap[$propelType])) {
            throw new EngineException("Cannot map unknown Propel type " . var_export($propelType, true) . " to native database type.");
        }

        return $this->schemaDomainMap[$propelType];
    }