/** * Return the factory for the given entity definition * * @param EntityInterface $meta * * @return EntityFactoryInterface */ public function get(EntityInterface $meta) : EntityFactoryInterface { $class = (string) $meta->factory(); if ($this->mapping->contains($class)) { return $this->mapping->get($class); } $factory = new $class(); $this->register($factory); return $factory; }