protected function determineResourceClass($className) { if (Tool::classExists($className)) { return $className; } return parent::determineResourceClass($className); }
/** * @param AbstractListing $list */ protected static function loadToCache(AbstractListing $list) { $totalCount = $list->getTotalCount(); $iterations = ceil($totalCount / self::getPerIteration()); \Logger::info("New list of elements queued for storing into the cache with " . $iterations . " iterations and " . $totalCount . " total items"); for ($i = 0; $i < $iterations; $i++) { \Logger::info("Starting iteration " . $i . " with offset: " . self::getPerIteration() * $i); $list->setLimit(self::getPerIteration()); $list->setOffset(self::getPerIteration() * $i); $elements = $list->load(); foreach ($elements as $element) { $cacheKey = Element\Service::getElementType($element) . "_" . $element->getId(); Cache::storeToCache($element, $cacheKey, [], null, null, true); } \Pimcore::collectGarbage(); sleep(self::getTimoutBetweenIteration()); } }
/** * @param string $condition * @return $this */ public function setCondition($condition, $conditionVariables = null) { $this->reset(); return parent::setCondition($condition, $conditionVariables); // TODO: Change the autogenerated stub }
/** * @param $condition * @param null $conditionVariables * @return $this */ public function setCondition($condition, $conditionVariables = null) { $this->reset(); return parent::setCondition($condition, $conditionVariables); }
/** * @param $groupBy * @param bool $qoute * @return $this */ public function setGroupBy($groupBy, $qoute = true) { $this->reset(); return parent::setGroupBy($groupBy, $qoute); // TODO: Change the autogenerated stub }
/** * Returns the SQL condition value. * * @return string */ public function getCondition() { $condition = parent::getCondition(); if ($condition) { if (Document::doHideUnpublished() && !$this->getUnpublished()) { $condition = " (" . $condition . ") AND published = 1"; } } elseif (Document::doHideUnpublished() && !$this->getUnpublished()) { $condition = "published = 1"; } return $condition; }