コード例 #1
0
ファイル: RepositoryTest.php プロジェクト: plan2net/TYPO3.CMS
 /**
  * @test
  * @expectedException \TYPO3\CMS\Extbase\Persistence\Exception\IllegalObjectTypeException
  */
 public function updateRejectsObjectsOfWrongType()
 {
     $this->repository->_set('objectType', 'Foo');
     $this->repository->update(new \stdClass());
 }
コード例 #2
0
ファイル: DocumentRepository.php プロジェクト: pkerling/rest
 /**
  * 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);
 }
コード例 #3
0
ファイル: AbstractRepository.php プロジェクト: rabe69/yag
 /**
  * (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);
 }
コード例 #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();
 }