Source of file RESTCollection.php
Size: 0,824 Bytes - Last Modified: 2021-12-23T10:33:56+00:00
/var/www/docs.ssmods.com/process/src/code/RESTCollection.php
1234567891011121314151617181920212223242526272829 | <?php /** * A RESTCollection is a Noun that contains a collection of Items * * Difference between Collection and Items * * - Collection only has one type of Item nested under it, but it can have multiple of that type of Item * - Item has many types of Nouns (Collections & Items) nested under it, but it can only have one of each type of Noun */ trait RESTCollection { use RESTNoun; abstract function getItems(); abstract function getItem($id); function LinkFor($item) { if ($item->parent !== $this) user_error('Tried to get link for noun that was not gotten from this collection', E_USER_ERROR); return Controller::join_links($this->Link(), $item->getID()); } protected function markAsNested($obj) { $obj->parent = $this; return $obj; } } class RESTCollection_Handler extends RESTNoun_Handler { } |