clear() public method

Clears the ObjectManager. All objects that are currently managed by this ObjectManager become detached.
public clear ( string $objectName = null )
$objectName string if given, only objects of this type will get detached
Exemplo n.º 1
0
 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);
 }