public function getSubTypes($criteria = null, PropelPDO $con = null) { $cacheKey = __CLASS__ . "::" . __METHOD__ . "::" . $this->getId(); $subtypes = ApplicationCache::getInstance()->get($cacheKey); if (!$subtypes) { $subtypes = parent::getSubTypes($criteria, $con); ApplicationCache::getInstance()->set($cacheKey, $subtypes, MEMCACHE_COMPRESSED, 86400); } return $subtypes; }
public static function getAllTypes() { $cacheKey = __CLASS__ . "::" . __METHOD__; $types = ApplicationCache::getInstance()->get($cacheKey); if (!$types || count($types) == 0) { $types = self::create()->orderByTitle()->find(); ApplicationCache::getInstance()->set($cacheKey, $types, MEMCACHE_COMPRESSED, 86400); } return $types; }
public static function getAllDisciplines() { $cacheKey = __CLASS__ . "::" . __METHOD__; $all = ApplicationCache::getInstance()->get($cacheKey); if (!$all) { $all = self::create()->orderByName()->find(); ApplicationCache::getInstance()->set($cacheKey, $all, MEMCACHE_COMPRESSED, 86400); } return $all; }
/** * Get the associated ItemSubType object * * @param PropelPDO $con Optional Connection object. * @return ItemSubType The associated ItemSubType object. * @throws PropelException */ public function getItemSubType(PropelPDO $con = null) { if ($this->aItemSubType === null && $this->item_sub_type_id !== null) { $cacheKey = __CLASS__ . "::" . __METHOD__ . "::" . $this->getDataId(); $this->aItemSubType = ApplicationCache::getInstance()->get($cacheKey); if ($this->aItemSubType == static::FALSE_POSITIVE) { $this->aItemSubType = null; } else { if (!$this->aItemSubType) { $this->aItemSubType = ItemSubTypeQuery::create()->filterByItem($this)->filterByMainTypeId($this->getItemTypeId())->findOne($con); ApplicationCache::getInstance()->set($cacheKey, $this->aItemSubType ?: static::FALSE_POSITIVE, MEMCACHE_COMPRESSED, 86400); } } } return $this->aItemSubType; }