コード例 #1
0
 protected function hasCachedRootObjects(IRelatedObject $object)
 {
     $peer = $object->getPeer();
     if (!$peer instanceof IRelatedObjectPeer) {
         return false;
     }
     if ($peer->isReferenced($object)) {
         return false;
     }
     if (isset($this->queryCache[kResponseProfileCacher::CACHE_ROOT_OBJECTS])) {
         return true;
     }
     $roots = $peer->getRootObjects($object);
     foreach ($roots as $index => $root) {
         if (!$this->isCachedObject($root)) {
             unset($roots[$index]);
         }
     }
     if (count($roots)) {
         $this->queryCache[kResponseProfileCacher::CACHE_ROOT_OBJECTS] = $roots;
         return true;
     }
     return false;
 }
コード例 #2
0
 private static function getObjectTypeCacheValue(IRelatedObject $object)
 {
     return array('type' => 'relatedObject', 'triggerKey' => self::getRelatedObjectKey($object), 'objectType' => get_class(self::$cachedObject) . '_' . self::$responseProfileKey, 'objectPeer' => get_class(self::$cachedObject->getPeer()), 'triggerObjectType' => get_class($object), 'partnerId' => self::$cachedObject->getPartnerId(), 'responseProfileKey' => self::$responseProfileKey, 'sessionKey' => self::getSessionKey());
 }