/**
  * @param \TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject $object Object to use
  * @param boolean $clearCacheOnAllHashesForCurrentPage Clear cache on all hashes for current page
  * @return string the rendered string
  */
 public function render(\TYPO3\CMS\Extbase\DomainObject\AbstractDomainObject $object = NULL, $clearCacheOnAllHashesForCurrentPage = false)
 {
     if ($clearCacheOnAllHashesForCurrentPage) {
         $this->trackingManager->trackObjectOnPage($object, 'id');
     } else {
         $this->trackingManager->trackObjectOnPage($object, 'hash');
     }
     return $this->renderChildren();
 }
Пример #2
0
 /**
  * This method is called by a hook in the TYPO3 Core Engine (TCEmain) when a create or update action is performed on a record.
  *
  * @param	string $status Operation status
  * @param	string $table The table TCEmain is currently processing
  * @param	string $rawId The records id (if any)
  * @param	array $fieldArray The field names and their values to be processed (passed by reference)
  * @param	\TYPO3\CMS\Core\DataHandling\DataHandler $pObj  Reference to the parent object (TCEmain)
  * @return	void
  * @access public
  */
 public function processDatamap_afterDatabaseOperations($status, $table, $rawId, $fieldArray, $pObj)
 {
     if (!\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($rawId)) {
         $rawId = $pObj->substNEWwithIDs[$rawId];
     }
     if (\TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($rawId)) {
         $objectIdentifier = $this->trackingManager->getObjectIdentifierForRecord($table, $rawId);
         $this->trackingManager->clearPageCacheForObjectIdentifier($objectIdentifier);
         if ($fieldArray['pid'] && \TYPO3\CMS\Core\Utility\MathUtility::canBeInterpretedAsInteger($fieldArray['pid'])) {
             $pid = $fieldArray['pid'];
         } else {
             $row = \TYPO3\CMS\Backend\Utility\BackendUtility::getRecord($table, $rawId);
             $pid = $row['pid'];
         }
         if ($pid > 0) {
             $objectIdentifier = $this->trackingManager->getObjectIdentifierForRepository($table, $pid);
             $this->trackingManager->clearPageCacheForObjectIdentifier($objectIdentifier);
             $objectIdentifier = $this->trackingManager->getObjectIdentifierForRepository($table, -1);
             $this->trackingManager->clearPageCacheForObjectIdentifier($objectIdentifier);
         }
     }
 }