/**
  * Removes the specified validator.
  *
  * @param Tx_Extbase_Validation_ValidatorInterface $validator The validator to remove
  */
 public function removeValidator(Tx_Extbase_Validation_Validator_ValidatorInterface $validator)
 {
     if (!$this->validators->contains($validator)) {
         throw new Tx_Extbase_Validation_Exception_NoSuchValidator('Cannot remove validator because its not in the conjunction.', 1207020177);
     }
     $this->validators->detach($validator);
 }
Example #2
0
 /**
  * Replaces an object by another.
  *
  * @param object $existingObject The existing object
  * @param object $newObject The new object
  * @return void
  * @api
  */
 public function replace($existingObject, $newObject)
 {
     if (!$existingObject instanceof $this->objectType) {
         throw new Tx_Extbase_Persistence_Exception_IllegalObjectType('The existing object given to replace was not of the type (' . $this->objectType . ') this repository manages.', 1248363434);
     }
     if (!$newObject instanceof $this->objectType) {
         throw new Tx_Extbase_Persistence_Exception_IllegalObjectType('The new object given to replace was not of the type (' . $this->objectType . ') this repository manages.', 1248363439);
     }
     $backend = $this->persistenceManager->getBackend();
     $session = $this->persistenceManager->getSession();
     $uuid = $backend->getIdentifierByObject($existingObject);
     if ($uuid !== NULL) {
         $backend->replaceObject($existingObject, $newObject);
         $session->unregisterReconstitutedObject($existingObject);
         $session->registerReconstitutedObject($newObject);
         if ($this->removedObjects->contains($existingObject)) {
             $this->removedObjects->detach($existingObject);
             $this->removedObjects->attach($newObject);
         }
     } elseif ($this->addedObjects->contains($existingObject)) {
         $this->addedObjects->detach($existingObject);
         $this->addedObjects->attach($newObject);
     } else {
         throw new Tx_Extbase_Persistence_Exception_UnknownObject('The "existing object" is unknown to the persistence backend.', 1238068475);
     }
 }
Example #3
0
 /**
  * Unregister an object
  *
  * @param string $object
  * @return void
  * @author Karsten Dambekalns <*****@*****.**>
  */
 public function unregisterObject($object)
 {
     unset($this->uuidMap[get_class($object)][$this->objectMap[$object]]);
     $this->objectMap->detach($object);
 }
Example #4
0
 /**
  * @test
  */
 public function removeVideoFromObjectStorageHoldingVideos()
 {
     $video = new Tx_WinkelVideolist_Domain_Model_Video();
     $localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
     $localObjectStorage->attach($video);
     $localObjectStorage->detach($video);
     $this->fixture->addVideo($video);
     $this->fixture->removeVideo($video);
     $this->assertEquals($localObjectStorage, $this->fixture->getVideos());
 }
Example #5
0
 /**
  * @test
  */
 public function removeParticipationFromObjectStorageHoldingParticipations()
 {
     $participation = new Tx_Nbowishlist_Domain_Model_Participation();
     $localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
     $localObjectStorage->attach($participation);
     $localObjectStorage->detach($participation);
     $this->fixture->addParticipation($participation);
     $this->fixture->removeParticipation($participation);
     $this->assertEquals($localObjectStorage, $this->fixture->getParticipations());
 }
 /**
  * @test
  */
 public function removeContactFromObjectStorageHoldingContacts()
 {
     $contact = new Tx_WinkelAddress_Domain_Model_Contact();
     $localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
     $localObjectStorage->attach($contact);
     $localObjectStorage->detach($contact);
     $this->fixture->addContact($contact);
     $this->fixture->removeContact($contact);
     $this->assertEquals($localObjectStorage, $this->fixture->getContacts());
 }
Example #7
0
	/**
	 * @test
	 */
	public function removeCompanyFromObjectStorageHoldingCompanies() {
		$company = new Tx_Nbomn_Domain_Model_Company();
		$localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
		$localObjectStorage->attach($company);
		$localObjectStorage->detach($company);
		$this->fixture->addCompany($company);
		$this->fixture->removeCompany($company);

		$this->assertEquals(
			$localObjectStorage,
			$this->fixture->getCompanies()
		);
	}
Example #8
0
 /**
  * @test
  */
 public function removeSubscriberFromObjectStorageHoldingSubscribers()
 {
     $subscriber = new Tx_WoehrlSeminare_Domain_Model_Subscriber();
     $localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
     $localObjectStorage->attach($subscriber);
     $localObjectStorage->detach($subscriber);
     $this->fixture->addSubscriber($subscriber);
     $this->fixture->removeSubscriber($subscriber);
     $this->assertEquals($localObjectStorage, $this->fixture->getSubscribers());
 }
Example #9
0
 /**
  * Unregisters a reconstituted object
  *
  * @param Tx_Extbase_DomainObject_DomainObjectInterface $object
  * @return void
  */
 public function unregisterReconstitutedObject(Tx_Extbase_DomainObject_DomainObjectInterface $object)
 {
     $this->reconstitutedObjects->detach($object);
 }
Example #10
0
 /**
  * @test
  */
 public function removeTagFromObjectStorageHoldingTags()
 {
     $tag = new Tx_Nxshowroom_Domain_Model_Tags();
     $localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
     $localObjectStorage->attach($tag);
     $localObjectStorage->detach($tag);
     $this->fixture->addTag($tag);
     $this->fixture->removeTag($tag);
     $this->assertEquals($localObjectStorage, $this->fixture->getTags());
 }
Example #11
0
 /**
  * @test
  */
 public function removePageFromObjectStorageHoldingPages()
 {
     $page = new Tx_Hrinewsletter_Domain_Model_Pages();
     $localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
     $localObjectStorage->attach($page);
     $localObjectStorage->detach($page);
     $this->fixture->addPage($page);
     $this->fixture->removePage($page);
     $this->assertEquals($localObjectStorage, $this->fixture->getPages());
 }
 /**
  * @test
  */
 public function removeShimFromObjectStorageHoldingShims()
 {
     $shim = new Tx_WinkelProducts_Domain_Model_Shim();
     $localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
     $localObjectStorage->attach($shim);
     $localObjectStorage->detach($shim);
     $this->fixture->addShim($shim);
     $this->fixture->removeShim($shim);
     $this->assertEquals($localObjectStorage, $this->fixture->getShims());
 }
 /**
  * @see Tx_Extbase_Persistence_ObjectStorage::detach
  */
 public function detach($object)
 {
     $this->initialize();
     parent::detach($object);
 }
Example #14
0
	/**
	 * @test
	 */
	public function removeParentcategoryFromObjectStorageHoldingParentcategory() {
		$parentcategory = new Tx_Nbomn_Domain_Model_Category();
		$localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
		$localObjectStorage->attach($parentcategory);
		$localObjectStorage->detach($parentcategory);
		$this->fixture->addParentcategory($parentcategory);
		$this->fixture->removeParentcategory($parentcategory);

		$this->assertEquals(
			$localObjectStorage,
			$this->fixture->getParentcategory()
		);
	}
Example #15
0
 /**
  * @test
  */
 public function removeResourceFromObjectStorageHoldingResource()
 {
     $resource = new Tx_Nxshowroom_Domain_Model_Resource();
     $localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
     $localObjectStorage->attach($resource);
     $localObjectStorage->detach($resource);
     $this->fixture->addResource($resource);
     $this->fixture->removeResource($resource);
     $this->assertEquals($localObjectStorage, $this->fixture->getResource());
 }
 /**
  * @test
  */
 public function removeAddressFromObjectStorageHoldingAddresses()
 {
     $address = new Tx_WinkelAddress_Domain_Model_Address();
     $localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
     $localObjectStorage->attach($address);
     $localObjectStorage->detach($address);
     $this->fixture->addAddress($address);
     $this->fixture->removeAddress($address);
     $this->assertEquals($localObjectStorage, $this->fixture->getAddresses());
 }
 /**
  * @test
  */
 public function removeStaticCountryFromObjectStorageHoldingStaticCountry()
 {
     $staticCountry = new Tx_Temp_Domain_Model_StaticCountry();
     $localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
     $localObjectStorage->attach($staticCountry);
     $localObjectStorage->detach($staticCountry);
     $this->fixture->addStaticCountry($staticCountry);
     $this->fixture->removeStaticCountry($staticCountry);
     $this->assertEquals($localObjectStorage, $this->fixture->getStaticCountry());
 }
Example #18
0
	/**
	 * @test
	 */
	public function removeTrackFromObjectStorageHoldingTrack() {
		$track = new Tx_Nbomn_Domain_Model_Track();
		$localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
		$localObjectStorage->attach($track);
		$localObjectStorage->detach($track);
		$this->fixture->addTrack($track);
		$this->fixture->removeTrack($track);

		$this->assertEquals(
			$localObjectStorage,
			$this->fixture->getTrack()
		);
	}
Example #19
0
 /**
  * @test
  */
 public function removeParentFromObjectStorageHoldingParent()
 {
     $parent = new Tx_WoehrlSeminare_Domain_Model_Location();
     $localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
     $localObjectStorage->attach($parent);
     $localObjectStorage->detach($parent);
     $this->fixture->addParent($parent);
     $this->fixture->removeParent($parent);
     $this->assertEquals($localObjectStorage, $this->fixture->getParent());
 }
 /**
  * @test
  */
 public function removeWasherFromObjectStorageHoldingWasher()
 {
     $washer = new Tx_WinkelProducts_Domain_Model_Washer();
     $localObjectStorage = new Tx_Extbase_Persistence_ObjectStorage();
     $localObjectStorage->attach($washer);
     $localObjectStorage->detach($washer);
     $this->fixture->addWasher($washer);
     $this->fixture->removeWasher($washer);
     $this->assertEquals($localObjectStorage, $this->fixture->getWasher());
 }