/** * @param NodeDefinition $node * @param null|int $seed * @return ObjectCollection */ public function processNodeDefinition(NodeDefinition $node, $seed) { $collection = new ObjectCollection(); for ($i = 0; $i < $node->getAmount(); $i++) { $id = $this->faker->generate('uuid', [], null, true); $n = new Node($id); $n->addLabels($node->getLabels()->toArray()); foreach ($node->getProperties() as $property) { $n->addProperty($property->getName(), $this->getFakeData($property, $seed)); } $collection->add($n); $this->nodes->add($n); } $this->nodesByIdentifier->set($node->getIdentifier(), $collection); }