/**
  * Removes a role from this repository.
  *
  * @param \TYPO3\Flow\Security\Policy\Role $role The role to remove
  * @return void
  */
 public function remove($role)
 {
     if (isset($this->newRoles[$role->getIdentifier()])) {
         unset($this->newRoles[$role->getIdentifier()]);
     }
     parent::remove($role);
 }
 /**
  * Removes an account
  *
  * @param object $object The account to remove
  * @return void
  * @throws \TYPO3\Flow\Persistence\Exception\IllegalObjectTypeException
  */
 public function remove($object)
 {
     parent::remove($object);
     /** @var Account $object */
     $tag = 'TYPO3-Flow-Security-Account-' . md5($object->getAccountIdentifier());
     $this->sessionManager->destroySessionsByTag($tag, sprintf('The account %s (%s) was deleted', $object->getAccountIdentifier(), $object->getAuthenticationProviderName()));
 }
 /**
  * Removes a Resource object from this repository
  *
  * @param object $object
  * @return void
  */
 public function remove($object)
 {
     // Intercept a second call for the same Resource object because it might cause an endless loop caused by
     // the ResourceManager's deleteResource() method which also calls this remove() function:
     if (!$this->removedResources->contains($object)) {
         $this->removedResources->attach($object);
         parent::remove($object);
     }
 }
Beispiel #4
0
 /**
  * Removes an object from this repository.
  * First we must remove all references to this object.
  *
  * @param object $object The object to remove
  * @return void
  * @api
  */
 public function remove($object)
 {
     if ($object instanceof \_OurBrand_\Quiz\Domain\Model\Quiz) {
         $copies = $this->findByCopyOf($object);
         /** @var \_OurBrand_\Quiz\Domain\Model\Quiz $copy */
         foreach ($copies as $copy) {
             $copy->setCopyOf(null);
             $copy->setWasCopyOf($object->getTitle());
             $this->update($copy);
         }
         $snapshots = $object->getSnapshots();
         /** @var \_OurBrand_\Quiz\Domain\Model\Quiz $snapshot */
         foreach ($snapshots as $snapshot) {
             // Todo: Check if snapshot is assigned. If assigned
             // throw exception.
             $snapshot->setSnapshotOf(null);
             $this->remove($snapshot);
         }
     }
     parent::remove($object);
 }
 /**
  * Removes an object to the persistence.
  *
  * This repository keeps track of added and removed nodes (additionally to the
  * other Unit of Work) in order to find in-memory nodes.
  *
  * @param object $object The object to remove
  * @return void
  * @api
  */
 public function remove($object)
 {
     if ($object instanceof NodeInterface) {
         $object = $object->getNodeData();
     }
     if ($this->addedNodes->contains($object)) {
         $this->addedNodes->detach($object);
     }
     if (!$this->removedNodes->contains($object)) {
         $this->removedNodes->attach($object);
     }
     parent::remove($object);
 }
 /**
  * Remove the asset even if it is still in use. Use with care, it is probably
  * better to first make sure the asset is not used anymore and then use
  * the remove() method for removal.
  *
  * @param AssetInterface $object
  * @return void
  */
 public function removeWithoutUsageChecks($object)
 {
     parent::remove($object);
     $this->assetService->emitAssetRemoved($object);
 }