newInstance() public method

Creates a new instance of the mapped class, without invoking the constructor.
public newInstance ( ) : object
return object
Exemplo n.º 1
0
 /**
  * @depends testMapField
  */
 public function testNewInstance(ClassMetadata $cm)
 {
     $instance1 = $cm->newInstance();
     $instance2 = $cm->newInstance();
     $this->assertInstanceOf('Doctrine\\Tests\\ODM\\PHPCR\\Mapping\\Person', $instance1);
     $this->assertNotSame($instance1, $instance2);
 }