Ejemplo n.º 1
0
 public function testRemoveRelation()
 {
     $this->assertEquals($this->object->count(), 0);
     $this->object->addRelation($this->relation);
     $this->assertEquals($this->object->count(), 1);
     $res = $this->object->removeRelation($this->relation);
     $this->assertTrue($res);
     $this->assertEquals($this->object->count(), 0);
     $res = $this->object->removeRelation($this->relation);
     $this->assertFalse($res);
     $this->assertEquals($this->object->count(), 0);
 }
Ejemplo n.º 2
0
 /**
  * removeRelation
  *
  * @param   KVDthes_Relation $relation
  * @return  void
  */
 public function removeRelation(KVDthes_Relation $relation)
 {
     $this->checkRelations();
     if ($this->relations->removeRelation($relation)) {
         //verwijder de inverse relatie
         $relation->getTerm()->removeRelation(new KVDthes_Relation($relation->getInverseRelation(), $this));
         $this->markDirty();
     }
 }