/** @inheritdoc */ public function attach(IEntity $entity) { if (!$entity->isAttached()) { $entity->fireEvent('onAttach', [$this, $this->metadataStorage->get(get_class($entity))]); if ($this->dependencyProvider) { $this->dependencyProvider->injectDependencies($entity); } } }