public function setRepository(Repository $repository) { $this->repository = $repository; return $this; }