public function getMetadataStorage();
public function onModelAttach(IModel $model) { if ($this->model && $this->model !== $model) { throw new InvalidStateException('Repository is already attached.'); } $this->model = $model; $this->metadataStorage = $model->getMetadataStorage(); }