/** * * @param string $id * @return Routine */ private function getRoutine($id) { if (!$this->routines->has($id)) { $routine = new Routine(); $routine->setName('Routine #' . $id); $this->routines->set($id, $routine); } return $this->routines->get($id); }