/** * * @param unknown $id * @param Rhapsody\SetupBundle\Model\Object $object */ public function add($id, $object) { $_id = strtolower(trim($id)); if (array_key_exists($_id, $this->cache)) { throw new \Exception('Unable to add object: ' . $object->getClassName() . ' with ID: ' . $id . '. An object already exists in the cache with that identifier.'); } $this->cache[$_id] = $object; }