/** * Deletes an object * * @param Tx_Extbase_DomainObject_DomainObjectInterface $object The object to be insterted in the storage * @param Tx_Extbase_DomainObject_AbstractEntity|NULL $parentObject The parent object (if any) * @param string|NULL $parentPropertyName The name of the property * @param bool $markAsDeleted Shold we only mark the row as deleted instead of deleting (TRUE by default)? * @return void */ protected function removeObject(Tx_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(); $res = $this->storageBackend->updateRow($tableName, array('uid' => $object->getUid(), $deletedColumnName => 1)); } else { $res = $this->storageBackend->removeRow($tableName, array('uid' => $object->getUid())); } $this->removeRelatedObjects($object); if ($this->extbaseSettings['persistence']['updateReferenceIndex'] === '1') { $this->referenceIndex->updateRefIndexTable($tableName, $object->getUid()); } }
/** * Deletes an object * * @param Tx_Extbase_DomainObject_DomainObjectInterface $object The object to be insterted in the storage * @param Tx_Extbase_DomainObject_AbstractEntity|NULL $parentObject The parent object (if any) * @param string|NULL $parentPropertyName The name of the property * @param bool $markAsDeleted Shold we only mark the row as deleted instead of deleting (TRUE by default)? * @return void */ protected function removeObject(Tx_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(); $res = $this->storageBackend->updateRow($tableName, array('uid' => $object->getUid(), $deletedColumnName => 1)); } else { $res = $this->storageBackend->removeRow($tableName, array('uid' => $object->getUid())); } $this->removeRelatedObjects($object); $frameworkConfiguration = $this->configurationManager->getConfiguration(Tx_Extbase_Configuration_ConfigurationManagerInterface::CONFIGURATION_TYPE_FRAMEWORK); if ($frameworkConfiguration['persistence']['updateReferenceIndex'] === '1') { $this->referenceIndex->updateRefIndexTable($tableName, $object->getUid()); } }