flush() public method

public flush ( )
Beispiel #1
0
 /**
  * Updates a group.
  *
  * @param GroupInterface $group
  */
 public function updateGroup(GroupInterface $group, $andFlush = true)
 {
     $this->dm->persist($group);
     if ($andFlush) {
         $this->dm->flush();
     }
 }
 /**
  * Updates a user.
  *
  * @extra:SecureParam(name="user", permissions="EDIT")
  * @param UserInterface $user
  * @param Boolean $andFlush Whether to flush the changes (default true)
  */
 public function updateUser(UserInterface $user, $andFlush = true)
 {
     $this->updateCanonicalFields($user);
     $this->updatePassword($user);
     $this->dm->persist($user);
     if ($andFlush) {
         $this->dm->flush();
     }
 }
 public function testLoadingMappedsuperclass()
 {
     $document = new ExtendingClass();
     $document->topic = 'Superclass test';
     $document->headline = 'test test test';
     $this->dm->persist($document);
     $this->dm->flush();
     $id = $document->id;
     $this->dm->clear();
     $doc = $this->dm->find('Doctrine\\Tests\\Models\\Mapping\\ExtendingClass', $id);
     $this->assertInstanceOf('\\Doctrine\\Tests\\Models\\Mapping\\ExtendingClass', $doc);
     $this->assertEquals('test test test', $doc->headline);
     $this->assertEquals('Superclass test', $doc->topic);
 }
 /**
  * @return void
  */
 public function flush()
 {
     try {
         $this->documentManager->flush();
     } catch (\Exception $exception) {
         $this->systemLogger->log('Could not flush ODM unit of work, error: ' . $exception->getMessage());
     }
 }
 /**
  * Convenience method for flushing the document manager
  *
  * @return void
  */
 public function flushDocumentManager()
 {
     $this->documentManager->flush();
 }