source: sandbox/2.4-expresso-api/prototype/rest/hypermedia/collection.php @ 6230

Revision 6230, 1.3 KB checked in by acoutinho, 12 years ago (diff)

Ticket #2758 - Implementacao dos recursos de contatos dinamicos no modelo de rest

  • Property svn:executable set to *
Line 
1<?php
2
3include_once('item.php');
4include_once('link.php');
5include_once('data.php');
6include_once('template.php');
7
8
9class Collection {
10
11    public $itens = array();
12    public $href;
13    public $error;
14    public $pagination;
15    public $queries;
16    public $template;
17    public $type;
18    public $data;
19
20    function __construct($config, $className) {
21        foreach ($config as $key => $value) {
22            if ($value['class'] == $className) {
23                $uri = $key;
24                break;
25            }
26        }
27        $this->href = $uri;
28    }
29
30    function addItem($item) {
31        $this->itens[] = $item;
32    }
33
34    function setData($data) {
35        $this->data = $data;
36    }
37
38    function getData() {
39        return $this->data;
40    }
41   
42    function setTemplate($template) {
43        $this->template = $template;
44    }
45
46    function getTemplate() {
47        return $this->template;
48    }
49
50    function setType($type) {
51        $this->type = $type;
52    }
53
54    function getType() {
55        return $this->type;
56    }
57
58    function setQueries($queries) {
59        $this->queries = $queries;
60    }
61
62    function getQueries() {
63        return $this->queries;
64    }
65
66    function setError($error) {
67        $this->error = $error;
68    }
69
70    function getError() {
71        return $this->error;
72    }
73
74    function setPagination($pagination) {
75        $this->pagination = $pagination;
76    }
77
78    function getPagination() {
79        return $this->pagination;
80    }
81
82}
83
84?>
Note: See TracBrowser for help on using the repository browser.