summaryrefslogtreecommitdiffstats
path: root/library/SSRS/Object/CatalogItems.php
blob: 6386cd53fa1ee44cdfe2e2c081865e09d026828b (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
<?php

namespace SSRS\Object;

/**
 * SSRS\Object\Abstract
 *
 * @author arron
 */
class CatalogItems extends ArrayIterator {

    public $iteratorKey = 'CatalogItems';

    public function init() {
        $this->data['CatalogItems'] = array();
    }

    public function setCatalogItems(\stdClass $items) {
        foreach ($items->CatalogItem AS $item) {
            $this->addCatalogItem(new CatalogItem($item));
        }
    }

    public function addCatalogItem(CatalogItem $item) {
        $this->data['CatalogItems'][] = $item;
    }

}