/** * Fills the data with the proper characteristic type. * * @param \Doctrine\Common\Collections\Collection $data * @param \Ekyna\Component\Characteristics\Schema\Definition $definition * @throws \InvalidArgumentException */ private function appendProperData(Collection $data, Definition $definition) { $identifier = $definition->getIdentifier(); if ($data->offsetExists($identifier)) { return; } $characteristic = $this->manager->createCharacteristicFromDefinition($definition); $data->set($identifier, $characteristic); }