Substitue to __construct() in order to easier call from parent class.

@param string           $collectionClass
@param MajoraNormalizer $normalizer
504904
private function setUp($collectionClass, MajoraNormalizer $normalizer)
    {
        if (empty($collectionClass) || !class_exists($collectionClass)) {
            throw new \InvalidArgumentException(sprintf(
                'You must provide a valid EntityCollection class name, "%s" given.',
                $collectionClass
            ));
        }
        $this->entityCollection = new $collectionClass();
        if (!$this->entityCollection instanceof EntityCollection) {
            throw new \InvalidArgumentException(sprintf(
                'Provided class name is not an Majora\Framework\Model\EntityCollection, "%s" given.',
                $collectionClass
            ));
        }

        $this->normalizer = $normalizer;
    }
1297093
public function createCollectionTranslation(Collection $collection, string $locale): void
    {
        $query = $this->connection->createQueryBuilder()
            ->insert('ngbm_collection_translation')
            ->values(
                [
                    'collection_id' => ':collection_id',
                    'status' => ':status',
                    'locale' => ':locale',
                ]
            )
            ->setParameter('collection_id', $collection->id, Type::INTEGER)
            ->setParameter('status', $collection->status, Type::INTEGER)
            ->setParameter('locale', $locale, Type::STRING);

        $query->execute();
    }
561338
public function filterModelCollectionAsContainer(Collection $collection)
    {
        parent::filterModelCollectionAsContainer($collection);

        $collection->filter(new Equals("Accepted", false));
    }
961053
protected function denormalizeCollection($collection, $class, $name, $format = null, array $context = array())
    {
        /** @var ClassMetadata $meta */
        $meta = $context['entityMeta'];

        $targetEntity = $meta->associationMappings[$name]['targetEntity'];

        $result = array();
        foreach ($collection as $key => $element) {
            $class = $class ?: $targetEntity;

            $result[$key] = $this->denormalizeAssociation($element, $class, $name, $format, $context);
        }

        return $result;
    }
677180
public function normalize($object, $format = null, array $context = []): array
    {
        if (!$object instanceof RelationCollection && !$object instanceof ActionCollection) {
            throw new \InvalidArgumentException(sprintf(
                'The normalizer support only "%s" or "%s" but "%s" given.',
                RelationCollection::class,
                ActionCollection::class,
                is_object($object) ? get_class($object) : gettype($object)
            ));
        }

        $data = [];

        foreach ($object as $relation) {
            $data[$relation->getName()] = $this->normalizer->normalize($relation, $format);
        }

        return $data;
    }
104720
private function initCollection(string $collection, string $class = null): void
    {
        $this->$collection = new Collection();
        $this->$collection->macroObject('createItem',
            function () use ($class): ?Assignable {
                if (null === $class) {
                    return null;
                }
                if (!class_exists($class)) {
                    throw new InvalidArgumentException(sprintf('Can not load class: %s', $class));
                }
                $item = new $class;
                if (!$item instanceof Assignable) {
                    throw new InvalidArgumentException(sprintf('%s must implement Assignable', $class));
                }

                return $item;
            });
    }
58757
private function addInheritedNamedNativeQueries(ClassMetadata $subClass, ClassMetadata $parentClass)
    {
        foreach ($parentClass->namedNativeQueries as $name => $query) {
            if ( ! isset ($subClass->namedNativeQueries[$name])) {
                $subClass->addNamedNativeQuery(array(
                    'name'              => $query['name'],
                    'query'             => $query['query'],
                    'isSelfClass'       => $query['isSelfClass'],
                    'resultSetMapping'  => $query['resultSetMapping'],
                    'resultClass'       => $query['isSelfClass'] ? $subClass->name : $query['resultClass'],
                ));
            }
        }
    }
469728
private function generateConstructorImpl(ClassMetadata $class)
    {
        $constructorImpl = <<<'EOT'
    /**
     * @param \Closure $initializer
     * @param \Closure $cloner
     */
    public function __construct($initializer = null, $cloner = null)
    {

EOT;
        $toUnset         = [];

        foreach ($this->getLazyLoadedPublicProperties($class) as $lazyPublicProperty => $unused) {
            $toUnset[] = '$this->' . $lazyPublicProperty;
        }

        $constructorImpl .= (empty($toUnset) ? '' : '        unset(' . implode(', ', $toUnset) . ");\n")
            . <<<'EOT'

        $this->__initializer__ = $initializer;
        $this->__cloner__      = $cloner;
    }
EOT;

        return $constructorImpl;
    }
433104
private static function loadDependency($parameterClass) {
		if (!isset(self::$instance[$parameterClass])) {
			/** @var DependencyManager $parameterDependency */
			$parameterDependency = $parameterClass;

			self::$loading[$parameterClass] = true;
			self::$instance[$parameterClass] = $parameterDependency::init();
		}

		return self::$instance[$parameterClass];
	}
174987
function writeNormalizeRml(store, writer) {
  normalizeRml(store, function () {
    let parsedBlankSubjects = {};
    writeBlanks(store, parsedBlankSubjects);
    let quads = store.getQuads();
    quads.forEach(function (quad) {
      if (parsedBlankSubjects[quad.subject]) {
        return;
      }
      if (parsedBlankSubjects[quad.object]) {
        writer.addQuad(quad.subject, quad.predicate, writer.blank(parsedBlankSubjects[quad.object]));
        return;
      }
      writer.addTriple(quad);
    });
  });
}
117571
public function normalizeField(
        string $path,
        $object,
        NormalizerContextInterface $context,
        NormalizerInterface $normalizer = null
    ) {
        if (null === $normalizer) {
            throw SerializerLogicException::createMissingNormalizer($path);
        }

        if (null === $relatedObject = $this->accessor->getValue($object)) {
            return null;
        }

        return $normalizer->normalize($relatedObject, $context, $path);
    }
83839
public function add(Normalize $normalize, string $identifier = '', string $chain = null) : Manager
    {
        if ($this->exists($identifier)) {
            throw new Exists("Instance with the name '{$identifier}' already exists");
        }

        // Set parent
        null !== $chain && $normalize->setChain($this->get($chain));

        $this->instances[$identifier] = $normalize;
        return $this;
    }
1161918
public function normalize($object, $format = null, array $context = array())
    {
        return $this->getNormalizer($object, $format)->normalize($object, $format, $context);
    }
1286008
private function addInheritedIndexes(ClassMetadata $subClass, ClassMetadata $parentClass)
    {
        if ($subClass->isEmbeddedDocument) {
            return;
        }

        $indexFactory = new IndexFactory($subClass);
        $parentIndex  = $parentClass->getIndex();

        if ($parentIndex !== null) {
            $index = $indexFactory->createInherited($parentIndex);
            $subClass->setIndex($index);
        }

        foreach ($parentClass->getSecondaryIndexes() as $parentIndex) {
            $index = $indexFactory->createInherited($parentIndex);
            $subClass->addSecondaryIndex($index);
        }
    }
222756
private NormalizerSerializerStrategy getStrategy(Normalizer normalizer) {
        for (NormalizerSerializerStrategy strategy : strategies) {
            if (strategySupportsNormalizer(strategy, normalizer.getType(), normalizer.getClass())) {
                return strategy;
            }
        }
        throw new RuntimeException(String.format(
                "No serializer strategy found for normalizer of class %s. If this is a custom normalizer, you probably "
                        + "forgot to register a corresponding custom serializer strategy with this serializer.",
                normalizer.getClass()));
    }
1164604
protected function processInitializer(Element $initializer) {
		$definition = new stdClass();
		
		if (isset($initializer->namespace)) {
			$definition->type      = 'namespace';
			$definition->namespace = $initializer->namespace;
		}
		else if (isset($initializer->class)) {
			$definition->type  = 'object';
			$definition->class = $initializer->class;
		}
		
		if ($initializer->factory === 'true') {
			$definition->factory = true;
		}
		
		$content = $initializer->getContent();
		
		if (! empty($content)) {
			$this->processDefinitionParameters($content, $definition);
		}
		
		return $definition;
	}
693045
public function normalize($object, $format = null, array $context = [])
    {
        if ($object !== $transformed = $this->transformOutput($object, $context)) {
            if (!$this->serializer instanceof NormalizerInterface) {
                throw new LogicException('Cannot normalize the transformed value because the injected serializer is not a normalizer');
            }

            $context['api_normalize'] = true;
            $context['api_resource'] = $object;
            unset($context['output']);

            return $this->serializer->normalize($transformed, $format, $context);
        }

        // Use resolved resource class instead of given resource class to support multiple inheritance child types
        $resourceClass = $this->resourceClassResolver->getResourceClass($object, $context['resource_class'] ?? null, true);
        $context = $this->initContext($resourceClass, $context);
        $iri = $context['iri'] ?? $this->iriConverter->getIriFromItem($object);
        $context['iri'] = $iri;
        $context['api_normalize'] = true;

        /*
         * When true, converts the normalized data array of a resource into an
         * IRI, if the normalized data array is empty.
         *
         * This is useful when traversing from a non-resource towards an attribute
         * which is a resource, as we do not have the benefit of {@see PropertyMetadata::isReadableLink}.
         *
         * It must not be propagated to subresources, as {@see PropertyMetadata::isReadableLink}
         * should take effect.
         */
        $emptyResourceAsIri = $context['api_empty_resource_as_iri'] ?? false;
        unset($context['api_empty_resource_as_iri']);

        if (isset($context['resources'])) {
            $context['resources'][$iri] = $iri;
        }

        $data = parent::normalize($object, $format, $context);
        if ($emptyResourceAsIri && \is_array($data) && 0 === \count($data)) {
            return $iri;
        }

        return $data;
    }