protected function onAttach(IRepository $repository, EntityMetadata $metadata) { $this->attach($repository); $this->metadata = $metadata; }