示例#1
0
 public function testSort()
 {
     $rel2 = new KVDthes_Relation(KVDthes_Relation::REL_RT, $this->gebied);
     $rel3 = new KVDthes_Relation(KVDthes_Relation::REL_RT, $this->locatie);
     $this->object->addRelation($this->relation);
     $this->object->addRelation($rel2);
     $this->object->addRelation($rel3);
     $this->object->sort(KVDthes_TermSorter::SORT_TERM);
     $coll = new KVDdom_DomainObjectCollection(array($rel2, $rel3, $this->relation));
     $this->assertEquals($coll, $this->object->getImmutableCollection());
     $this->object->sort(KVDthes_TermSorter::SORT_SORTKEY);
     $this->assertEquals($coll, $this->object->getImmutableCollection());
     $this->object->sort(KVDthes_TermSorter::SORT_QUALTERM);
     $this->assertEquals($coll, $this->object->getImmutableCollection());
     $this->object->sort(KVDthes_TermSorter::SORT_ID);
     $coll = new KVDdom_DomainObjectCollection(array($this->relation, $rel2, $rel3));
     $this->assertEquals($coll, $this->object->getImmutableCollection());
 }
示例#2
0
 /**
  * getRelations
  *
  * @return KVDdom_DomainObjectCollection
  */
 public function getRelations()
 {
     $this->checkRelations();
     return $this->relations->getImmutableCollection();
 }