/** * @param CacheMetaBag $cacheMetaBag * * @return array */ public function getTags(CacheMetaBag $cacheMetaBag) { $tags = array(); $userId = $cacheMetaBag->getParameter('leadersOf'); $tags[] = $this->getEntityOfUserTag(CacheTag::LEADER, $userId); return $tags; }
/** * @param mixed $entity * * @return CacheMetaBag */ public function createUpdateMetaBag($entity) { $cacheMetaBag = new CacheMetaBag(); $cacheMetaBag->setEntity($entity); $cacheMetaBag->setCacheTags(array(CacheTag::INSERT)); return $cacheMetaBag; }
/** * @param CacheMetaBag $cacheMetaBag * * @return array */ public function getTags(CacheMetaBag $cacheMetaBag) { $tags = array(); $userId = $cacheMetaBag->getParameter('reviewedBy'); $geonameSuffix = $this->getGeonameSuffix($cacheMetaBag); $tags[] = CacheTag::REVIEWED_BY . $userId . $geonameSuffix; return $tags; }
/** * @param CacheMetaBag $cacheMetaBag * * @return array */ public function getTags(CacheMetaBag $cacheMetaBag) { $tags = array(); foreach ($cacheMetaBag->getCacheTags() as $cacheTag) { $tags[] = $cacheTag; } return $tags; }
/** * @param CacheMetaBag $cacheMetaBag * * @return string */ protected function getGeonameSuffix(CacheMetaBag $cacheMetaBag) { $geonameId = $cacheMetaBag->getParameter('geoname'); if ($geonameId) { return CacheTag::GEONAME . $geonameId; } return ''; }
/** * @param CacheMetaBag $cacheMetaBag * * @return array */ public function getTags(CacheMetaBag $cacheMetaBag) { $tags = []; /** @var Tag $tag */ $tag = $cacheMetaBag->getEntity(); $tags[] = CacheTag::TAG; return $tags; }
/** * @param CacheMetaBag $cacheMetaBag * * @return array */ public function getTags(CacheMetaBag $cacheMetaBag) { $tags = []; /** @var PushMessage $pushMessage */ $pushMessage = $cacheMetaBag->getEntity(); $user = $pushMessage->getUser(); $tags[] = $this->getEntityOfUserTag(CacheTag::PUSH_MESSAGE, $user->getId()); return $tags; }
/** * @param CacheMetaBag $cacheMetaBag * * @return array */ public function getTags(CacheMetaBag $cacheMetaBag) { $tags = []; /** @var Restaurant $restaurant */ $restaurant = $cacheMetaBag->getEntity(); $geoname = $restaurant->getGeoname(); $tags[] = $this->getEntityInGeonameTag(CacheTag::RESTAURANT, $geoname->getId()); return $tags; }
/** * @param CacheMetaBag $cacheMetaBag * * @return array */ public function getTags(CacheMetaBag $cacheMetaBag) { $tags = []; /** @var Option $option */ $option = $cacheMetaBag->getEntity(); $user = $option->getUser(); $tags[] = CacheTag::OPTION . $option->getId(); $tags[] = $this->getEntityOfUserTag(CacheTag::OPTION, $user->getId()); return $tags; }
/** * @param CacheMetaBag $cacheMetaBag * * @return array */ public function getTags(CacheMetaBag $cacheMetaBag) { $tags = []; /** @var Photo $photo */ $photo = $cacheMetaBag->getEntity(); $user = $photo->getUser(); $geoname = $photo->getRestaurant()->getGeoname(); $tags[] = CacheTag::PHOTO . $user->getId(); $tags[] = $this->getEntityOfUserTag(CacheTag::REVIEW, $user->getId()); $tags[] = $this->getEntityOfUserInGeonameTag(CacheTag::REVIEW, $user->getId(), $geoname->getId()); return $tags; }
/** * @param CacheMetaBag $cacheMetaBag * * @return array */ public function getTags(CacheMetaBag $cacheMetaBag) { $tags = []; /** @var Review $review */ $review = $cacheMetaBag->getEntity(); $geoname = $review->getGeoname(); $user = $review->getUser(); $tags[] = $this->getEntityOfUserTag(CacheTag::REVIEW, $user->getId()); $tags[] = $this->getEntityTag(CacheTag::REVIEW, $review->getId()); $tags[] = $this->getEntityTag(CacheTag::USER, $user->getId()); // @TODO Because of the counter $tags[] = $this->getEntityOfUserInGeonameTag(CacheTag::REVIEW, $user->getId(), $geoname->getId()); return $tags; }
/** * @param CacheMetaBag $cacheMetaBag * * @return array */ public function getTags(CacheMetaBag $cacheMetaBag) { $tags = []; /** @var Wish $wish */ $wish = $cacheMetaBag->getEntity(); $geoname = $wish->getGeoname(); $user = $wish->getUser(); $tags[] = $this->getEntityOfUserTag(CacheTag::WISH, $user->getId()); $tags[] = $this->getEntityTag(CacheTag::WISH, $wish->getId()); $tags[] = $this->getEntityTag(CacheTag::USER, $user->getId()); // @TODO Because of the counter $tags[] = $this->getEntityOfUserInGeonameTag(CacheTag::WISH, $user->getId(), $geoname->getId()); return $tags; }
/** * @param CacheMetaBag $cacheMetaBag * * @return array */ public function getTags(CacheMetaBag $cacheMetaBag) { $tags = []; /** @var Connection $connection */ $connection = $cacheMetaBag->getEntity(); $follower = $connection->getFollower(); $leader = $connection->getLeader(); $tags[] = $this->getEntityTag(CacheTag::CONNECTION, $connection->getId()); $tags[] = $this->getEntityOfUserTag(CacheTag::FOLLOWER, $leader->getId()); $tags[] = $this->getEntityOfUserTag(CacheTag::LEADER, $follower->getId()); $tags[] = $this->getEntityTag(CacheTag::USER, $leader->getId()); // Because of counters $tags[] = $this->getEntityTag(CacheTag::USER, $follower->getId()); // Because of counters return $tags; }
/** * @param CacheMetaBag $cacheMetaBag * * @return boolean */ public function canTag(CacheMetaBag $cacheMetaBag) { return $cacheMetaBag->hasParameter('user'); }
/** * @param CacheMetaBag $cacheMetaBag * * @return boolean */ public function canTag(CacheMetaBag $cacheMetaBag) { return $cacheMetaBag->hasParameter('leadersOf'); }
/** * @param CacheMetaBag $cacheMetaBag * * @return boolean */ public function canTag(CacheMetaBag $cacheMetaBag) { return $cacheMetaBag->hasParameter('wishedBy'); }