@param DataInterface $data

@return DataInterface[]
483627
public function fetchEAVAssociations(DataInterface $data)
    {
        $qb = $this->createQueryBuilder('e');
        $qb
            ->join('e.refererValues', 'refererValues', Join::WITH, 'refererValues.data = :id')
            ->setParameter('id', $data->getId());
        $results = $qb->getQuery()->getResult();
        $loader = new OptimizedDataLoader($this->getEntityManager());
        $loader->load($results);

        return $results;
    }
196380
protected function resolveNestedRelations($data):array
    {
        if (is_null($data)) {
            return [];
        }

        $data = $data instanceof Model ? [$data] : $data;

        return collect($data)->flatMap(function ($model) {
            $relations = collect($model->getRelations());

            return $relations->keys()->merge($relations->flatMap(function ($relation, $key) {
                return collect($this->resolveNestedRelations($relation))->map(function ($nestedRelation) use ($key) {
                    return $key . '.' . $nestedRelation;
                });
            }));
        })->unique()->toArray();
    }
532788
protected function getFilterFromData($data): FilterInterface
    {
        if (($groupAndData = $this->getArrayValue($data, 'and')) !== null) {
            $group = new GroupAndFilter();
            foreach ($groupAndData as $filter) {
                $group->push($this->getFilterFromData($filter));
            }

            return $group;
        }
        if (($groupOrData = $this->getArrayValue($data, 'or')) !== null) {
            $group = new GroupOrFilter();
            foreach ($groupOrData as $filter) {
                $group->push($this->getFilterFromData($filter));
            }

            return $group;
        }

        // No group filter; must be a regular Filter
        $field = $this->getArrayValue($data, 'f');
        return new Filter($field, $this->getArrayValue($data, 'o'), $this->getArrayValue($data, 'd'));
    }
536914
public function createValue(DataInterface $data, AttributeInterface $attribute, array $context = null)
    {
        $valueClass = $this->getValueClass();
        /** @var ValueInterface $value */
        $value = new $valueClass($data, $attribute);
        $data->addValue($value);

        if ($value instanceof ContextualValueInterface
            && $data instanceof ContextualDataInterface
            && \count($attribute->getContextMask())
        ) {
            if ($context) {
                $context = array_merge($data->getCurrentContext(), $context);
            } else {
                $context = $data->getCurrentContext();
            }
            foreach ($attribute->getContextMask() as $key) {
                $value->setContextValue($key, $context[$key]);
            }
        }

        return $value;
    }
172261
private static function toArray($data) : array
    {
        if (($data instanceof ArrayObject)) {
            return $data->getArrayCopy();
        }
        if (is_null($data) || empty($data)) {
            return array();
        }

        return $data;
    }
112071
protected function normalizeDataSet(DataSetInterface $dataSet): DataSetInterface
    {
        $dataSet[ProductPackagingUnitDataSetInterface::COLUMN_IS_LEAD_PRODUCT] = (bool)$dataSet[ProductPackagingUnitDataSetInterface::COLUMN_IS_LEAD_PRODUCT];
        $dataSet[ProductPackagingUnitDataSetInterface::COLUMN_HAS_LEAD_PRODUCT] = (bool)$dataSet[ProductPackagingUnitDataSetInterface::COLUMN_HAS_LEAD_PRODUCT];
        $dataSet[ProductPackagingUnitDataSetInterface::COLUMN_IS_VARIABLE] = (bool)$dataSet[ProductPackagingUnitDataSetInterface::COLUMN_IS_VARIABLE];

        if ($dataSet[ProductPackagingUnitDataSetInterface::COLUMN_IS_LEAD_PRODUCT]) {
            $dataSet[ProductPackagingUnitDataSetInterface::COLUMN_HAS_LEAD_PRODUCT] = false;
        }

        $dataSet = $this->normalizeAmount($dataSet);

        return $dataSet;
    }
815349
protected function prepareQueueableEntities($data)
    {
        if ($data instanceof QueueableEntityInterface) {
            return $this->prepareQueueableEntity($data);
        }

        if (! is_array($data)) {
            return $data;
        }

        return array_map(function ($d)
        {
            if (is_array($d)) {
                return $this->prepareQueueableEntities($d);
            }

            return $this->prepareQueueableEntity($d);

        }, $data);
    }
704205
protected function buildResources($data, SerializerInterface $serializer)
    {
        $resources = [];

        foreach ($data as $resource) {
            if (! ($resource instanceof Resource)) {
                $resource = new Resource($resource, $serializer);
            }

            $resources[] = $resource;
        }

        return $resources;
    }
979662
private function getChildren(NodeInterface $node)
    {
        $result = [];
        foreach ($node->getNodes() as $child) {
            $result[$child->getIdentifier()] = $child;
        }

        return $result;
    }
1049359
public function getInterfaces()
    {
        $extendedInterfaces = [];
        $interfaces = parent::getInterfaces();
        foreach ($interfaces as $interface) {
            $extendedInterfaces[] = new ClassReflection($interface->getName());
        }
        return $extendedInterfaces;
    }
1307616
protected function getRelationshipDataRepresentation(RelationshipDataInterface $data): ?array
    {
        if ($data->isResource() === true) {
            return $this->getIdentifierRepresentationFromResource($data->getResource());
        } elseif ($data->isIdentifier() === true) {
            return $this->getIdentifierRepresentation($data->getIdentifier());
        } elseif ($data->isCollection() === true) {
            $representation = [];
            foreach ($data->getIdentifiers() as $identifier) {
                \assert($identifier instanceof IdentifierInterface);
                $representation[] = $this->getIdentifierRepresentation($identifier);
            }

            return $representation;
        }

        \assert($data->isNull() === true);

        return null;
    }
196328
public function prepareData($data = [])
    {
        return (array) ($this->data instanceof Closure ? call_user_func($this->data, $this, $data) : $this->data);
    }
294322
private function convertFromPg($data, TypeInterface $type)
    {
        if ($data === null) {
            return null;
        }

        if ($type instanceof ArrayType) {
            return $this->convertArrayFromPg($data, $type);
        }

        if (isset($this->mappings[(string) $type])) {
            return $this->convertCompositeFromPg($data, $type);
        }

        return $this->convertScalarFromPg($data, $type);
    }
812409
public function includedData(ResourceInterface $resource, array $data)
    {
        list($serializedData, $linkedIds) = $this->pullOutNestedIncludedData($data);

        foreach ($data as $value) {
            foreach ($value as $includeObject) {
                if ($this->isNull($includeObject) || $this->isEmpty($includeObject)) {
                    continue;
                }

                $includeObjects = $this->createIncludeObjects($includeObject);
                list($serializedData, $linkedIds) = $this->serializeIncludedObjectsWithCacheKey($includeObjects, $linkedIds, $serializedData);
            }
        }

        return empty($serializedData) ? [] : ['included' => $serializedData];
    }
1283800
public function mapCollectionReferences(array $data): array
    {
        $collectionReferences = [];

        foreach ($data as $dataItem) {
            $collectionReferences[] = CollectionReference::fromArray(
                [
                    'blockId' => (int) $dataItem['block_id'],
                    'blockStatus' => (int) $dataItem['block_status'],
                    'collectionId' => (int) $dataItem['collection_id'],
                    'collectionStatus' => (int) $dataItem['collection_status'],
                    'identifier' => $dataItem['identifier'],
                ]
            );
        }

        return $collectionReferences;
    }
713216
public function getNamesByDate(\DateTimeInterface $date): array
    {
        return $this->names[(int)$date->format('n')][(int)$date->format('j')];
    }
658857
public function transformToRelationshipObject(ResourceTransformation $transformation, DataInterface $data): ?array
    {
        if ($transformation->object === null || $transformation->resource === null) {
            return null;
        }

        $relationships = $transformation->resource->getRelationships($transformation->object);
        if (isset($relationships[$transformation->requestedRelationshipName]) === false) {
            throw $transformation->exceptionFactory->createRelationshipNotExistsException($transformation->requestedRelationshipName);
        }

        $defaultRelationships = $transformation->resource->getDefaultIncludedRelationships($transformation->object);

        $transformation->result = $this->transformRelationshipObject(
            $transformation,
            $data,
            $relationships[$transformation->currentRelationshipName],
            $defaultRelationships
        );

        return $transformation->result;
    }