예제 #1
0
 /**
  * @param Elector $object
  */
 public function remove($object)
 {
     foreach ($object->getElectorates() as $electorate) {
         $electorate->removeElector($object);
         $this->electorateRepository->update($electorate);
     }
     parent::remove($object);
 }
예제 #2
0
 /**
  * @test
  * @expectedException \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
  */
 public function removeChecksObjectType()
 {
     $this->repository->_set('objectType', 'ExpectedObjectType');
     $this->repository->remove(new \stdClass());
 }
예제 #3
0
 /**
  * (non-PHPdoc)
  * @see \TYPO3\CMS\Extbase\Persistence\Repository::remove()
  */
 public function remove($object)
 {
     parent::remove($object);
     $this->objectManager->get('Tx_Yag_PageCache_PageCacheManager')->markObjectUpdated($object);
 }
 /**
  * Removes resolution file cache object and file from filesystem
  *
  * @param Tx_Yag_Domain_Model_ResolutionFileCache $resolutionFileCache
  */
 public function remove($resolutionFileCache)
 {
     $cacheFilePath = Tx_Yag_Domain_FileSystem_Div::getT3BasePath() . $resolutionFileCache->getPath();
     if (file_exists($cacheFilePath)) {
         unlink(Tx_Yag_Domain_FileSystem_Div::getT3BasePath() . $resolutionFileCache->getPath());
         parent::remove($resolutionFileCache);
     }
 }
예제 #5
0
 /**
  * Removes an object from this repository.
  *
  * @param Document $object The object to remove
  * @throws NoDatabaseSelectedException if the given object and the repository have no database set
  * @return void
  * @api
  */
 public function remove($object)
 {
     if (!$object->_getDb()) {
         $currentDatabase = $this->getDatabase();
         if (!$currentDatabase) {
             throw new NoDatabaseSelectedException('The given object and the repository have no database set', 1389257938);
         }
         $object->_setDb($currentDatabase);
     }
     $this->willChangeDocument($object);
     parent::remove($object);
     $this->didChangeDocument($object);
 }