Ejemplo n.º 1
0
 public function testPagerOnePage()
 {
     $this->assertFalse($this->pager->haveToPaginate());
     $this->assertEquals(6, $this->pager->count());
     $this->assertEquals(6, $this->pager->getNbResults());
     $this->assertEquals(1, $this->pager->getFirstPage());
     $this->assertEquals(1, $this->pager->getLastPage());
     $this->assertEquals(array(1), $this->pager->getLinks(5));
 }
Ejemplo n.º 2
0
 public function transformList($data)
 {
     $xml = new \SimpleXMLElement($data);
     $list = new ListPager();
     foreach ($xml->projekt as $projekt) {
         $project = $this->transformSingle($projekt->asXML());
         $list->append($project);
     }
     if ($list->count() > 0) {
         $list->setMaxPerPage($list->count());
     }
     $list->setNbResults($list->count());
     return $list;
 }
Ejemplo n.º 3
0
 public function transformList($data)
 {
     $xml = new \SimpleXMLElement($data);
     $transformed = new ListPager();
     $transformed->setNbResults((int) $xml->{'query-result'}->count);
     if (isset($xml->immobilie)) {
         foreach ($xml->immobilie as $immobilie) {
             $objekt = $this->transformSingle($immobilie->asXML());
             $transformed->append($objekt);
         }
     }
     if ($transformed->count() > 0) {
         $transformed->setMaxPerPage($transformed->count());
     }
     return $transformed;
 }
Ejemplo n.º 4
0
 public function transformList($data)
 {
     $xml = new \SimpleXMLElement($data);
     $transformed = new ListPager();
     foreach ($xml->kategorie as $kategorie) {
         $attributes = $this->attributesToArray($kategorie);
         foreach ($kategorie->mitarbeiter as $mitarbeiter) {
             $member = $this->transformSingle($mitarbeiter->asXML());
             if (array_key_exists('name', $attributes)) {
                 $member->setCategory($attributes['name']);
             }
             $transformed->append($member);
         }
     }
     if ($transformed->count() > 0) {
         $transformed->setMaxPerPage($transformed->count());
     }
     $transformed->setNbResults($transformed->count());
     return $transformed;
 }