Ejemplo n.º 1
0
 /**
  * @test
  * @expectedException \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
  */
 public function updateRejectsObjectsOfWrongType()
 {
     $this->repository->_set('objectType', 'Foo');
     $this->repository->update(new \stdClass());
 }
Ejemplo n.º 2
0
 /**
  * Replaces an existing object with the same identifier by the given object
  *
  * @param Document $modifiedObject The modified object
  * @throws NoDatabaseSelectedException if the given object and the repository have no database set
  * @return void
  * @api
  */
 public function update($modifiedObject)
 {
     if (!$modifiedObject->_getDb()) {
         $currentDatabase = $this->getDatabase();
         if (!$currentDatabase) {
             throw new NoDatabaseSelectedException('The given object and the repository have no database set', 1389257938);
         }
         $modifiedObject->_setDb($currentDatabase);
     }
     $this->willChangeDocument($modifiedObject);
     parent::update($modifiedObject);
     $this->didChangeDocument($modifiedObject);
 }
Ejemplo n.º 3
0
 /**
  * (non-PHPdoc)
  * @see \TYPO3\CMS\Extbase\Persistence\Repository::update()
  */
 public function update($modifiedObject)
 {
     parent::update($modifiedObject);
     $this->objectManager->get('Tx_Yag_PageCache_PageCacheManager')->markObjectUpdated($modifiedObject);
 }
Ejemplo n.º 4
0
 /**
  * Update the object immediately in DB. This is used for time-sensitive operation such as locks.
  * @param object $modifiedObject
  */
 public function updateNow($modifiedObject)
 {
     parent::update($modifiedObject);
     $this->persistenceManager->persistAll();
 }