assertTrue($entity->isNew()); $this->assertEquals("romanb", $entity->username); } } class ConstructorTestEntity1 extends Doctrine_Entity { public function __construct($username = null) { parent::__construct(); if ($this->isNew()) { $this->username = $username; } } /* The mapping definition */ public static function initMetadata($class) { $class->mapColumn('id', 'integer', 4, array('primary')); $class->mapColumn('username', 'string', 50, array()); } } ?>