/** * Update quick data * * @return void */ public function updateQuickData() { if ($this->isPersistent()) { \XLite\Core\QuickData::getInstance()->updateProductData($this); } }
/** * \Counable::count * * @return integer */ public function count() { if (!isset($this->getOptions()->commonData['qdCount'])) { $this->getOptions()->commonData['qdCount'] = isset($this->getOptions()->commonData['calculateAllQuickData']) ? \XLite\Core\Database::getRepo('XLite\\Model\\Product')->countForQuickData() : \XLite\Core\QuickData::getInstance()->countUnprocessed(); } return $this->getOptions()->commonData['qdCount']; }
/** * Insert single entity * * @param \XLite\Model\AEntity|array $entity Data to insert OPTIONAL * * @return void */ protected function performInsert($entity = null) { $entity = parent::performInsert($entity); if ($entity && !\XLite\Core\Database::getRepo('XLite\\Model\\Product')->getBlockQuickDataFlag()) { \XLite\Core\QuickData::getInstance()->updateMembershipData($entity); } return $entity; }
/** * Execute certain hook handle * * @return void */ public function executeHookHandler() { if (static::isCalculateCacheAllowed() && \Includes\Decorator\Utils\CacheInfo::get('rebuildBlockMark')) { $i = static::getCounter(); do { $processed = \XLite\Core\QuickData::getInstance()->updateChunk($i, static::CHUNK_LENGTH); if (0 < $processed) { \XLite\Core\Database::getEM()->clear(); } $i += $processed; static::setCounter($i); \Includes\Utils\Operator::showMessage('.', false, true); } while (0 < $processed && !\Includes\Decorator\Utils\CacheManager::isTimeExceeds(static::STEP_TTL)); } }