LeanMapper\Entity::getBelongsToManyValue PHP Метод

getBelongsToManyValue() приватный Метод

private getBelongsToManyValue ( Property $property, LeanMapper\Relationship\BelongsToMany $relationship, Filtering $filtering = null ) : Entity[]
$property LeanMapper\Reflection\Property
$relationship LeanMapper\Relationship\BelongsToMany micro-optimalization
$filtering Filtering
Результат Entity[]
    private function getBelongsToManyValue(Property $property, Relationship\BelongsToMany $relationship, Filtering $filtering = null)
    {
        $targetTable = $relationship->getTargetTable();
        $rows = $this->row->referencing($targetTable, $relationship->getColumnReferencingSourceTable(), $filtering, $relationship->getStrategy());
        $value = [];
        foreach ($rows as $row) {
            $entityClass = $this->mapper->getEntityClass($targetTable, $row);
            $entity = $this->entityFactory->createEntity($entityClass, $row);
            $this->checkConsistency($property, $entityClass, $entity);
            $entity->makeAlive($this->entityFactory);
            $value[] = $entity;
        }
        return $this->entityFactory->createCollection($value);
    }