示例#1
0
 /**
  * Remove an object from the cache
  *
  * @param Cm_Mongo_Model_Abstract $object
  */
 public function removeObjectFromCache(Cm_Mongo_Model_Abstract $object)
 {
     $id = $this->_getItemKey($object->getId());
     if ($id !== NULL) {
         foreach ($this->_caches as $collection) {
             $collection->removeItemByKey($id);
         }
     }
 }
示例#2
0
 /**
  * Sets the referenced object. Stores an internal reference and sets the field to the object's ID.
  * 
  * @param string $field
  * @param Cm_Mongo_Model_Abstract $object
  * @return Cm_Mongo_Model_Abstract 
  */
 public function setReferencedObject($field, Cm_Mongo_Model_Abstract $object)
 {
     $this->setData($field, $object->getId());
     $this->_references[$field] = $object;
     return $this;
 }