Esempio n. 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());
 }
Esempio n. 2
0
 /**
  * sortRelations
  *
  * @param   integer     $methode    Een van de sort-constanten uit KVDthes_Relations.
  * @return void
  */
 public function sortRelations($methode)
 {
     $this->checkRelations();
     $this->relations->sort($methode);
 }