Ejemplo n.º 1
0
 public function testGetIteratorByType()
 {
     $this->object->addRelation($this->relation);
     $it = $this->object->getIterator(KVDthes_Relation::REL_RT);
     $this->assertInstanceOf('KVDthes_RelationTypeIterator', $it);
     $this->assertEquals(1, count($it));
     $this->assertEquals($it, $this->object->getRTIterator());
 }
 /**
  * getIterator
  *
  * @param KVDthes_Relations $relations
  * @return KVDthes_RelationsIterator
  */
 public function getIterator(KVDthes_Relations $relations)
 {
     return $relations->getIterator();
 }
Ejemplo n.º 3
0
 /**
  * clearRelations
  *
  * @param   string  $type   Een van de REL_ constanten uit de {@link KVDthes_Relation} class.
  * @return  void
  */
 public function clearRelations($type = null)
 {
     $this->checkRelations();
     $it = $this->relations->getIterator($type);
     foreach ($it as $relation) {
         $this->removeRelation($relation);
     }
 }