Example #1
0
 /**
  * Deletes an object
  *
  * @param \TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object The object to be removed from the storage
  * @param bool $markAsDeleted Whether to just flag the row deleted (default) or really delete it
  * @return void
  */
 protected function removeEntity(\TYPO3\CMS\Extbase\DomainObject\DomainObjectInterface $object, $markAsDeleted = true)
 {
     $dataMap = $this->dataMapper->getDataMap(get_class($object));
     $tableName = $dataMap->getTableName();
     if ($markAsDeleted === true && $dataMap->getDeletedFlagColumnName() !== null) {
         $deletedColumnName = $dataMap->getDeletedFlagColumnName();
         $row = array('uid' => $object->getUid(), $deletedColumnName => 1);
         $this->addCommonDateFieldsToRow($object, $row);
         $res = $this->storageBackend->updateRow($tableName, $row);
     } else {
         $res = $this->storageBackend->removeRow($tableName, array('uid' => $object->getUid()));
     }
     if ($res === true) {
         $this->emitAfterRemoveObjectSignal($object);
     }
     $this->removeRelatedObjects($object);
     $frameworkConfiguration = $this->configurationManager->getConfiguration(\TYPO3\CMS\Extbase\Configuration\ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK);
     if ($frameworkConfiguration['persistence']['updateReferenceIndex'] === '1') {
         $this->referenceIndex->updateRefIndexTable($tableName, $object->getUid());
     }
 }
 /**
  * update reference index
  *
  * @param integer $uid
  * @return void
  */
 protected function updateReferenceIndex($uid)
 {
     $this->referenceIndex->updateRefIndexTable('sys_file_reference', $uid);
 }