コード例 #1
0
ファイル: OneToManyTest.php プロジェクト: guiwoda/fluent
 protected function setUp()
 {
     $this->builder = new ClassMetadataBuilder(new ClassMetadataInfo(FluentEntity::class));
     // OneToMany needs to have the parent to be mapped
     $relation = new ManyToOne($this->builder, new DefaultNamingStrategy(), 'parent', FluentEntity::class);
     $relation->build();
     $this->relation = new OneToMany($this->builder, new DefaultNamingStrategy(), $this->field, FluentEntity::class);
     $this->relation->mappedBy('parent');
 }
コード例 #2
0
ファイル: ManyToOneTest.php プロジェクト: guiwoda/fluent
 public function test_can_set_onDelete()
 {
     $this->relation->onDelete('delete');
     $this->assertEquals('delete', $this->relation->getJoinColumn()->getOnDelete());
 }