You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+18-13Lines changed: 18 additions & 13 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -15,18 +15,17 @@ This package should be installed with composer and requires PHP 7+
15
15
```bash
16
16
composer install trms/carousel
17
17
```
18
-
## Instructions
19
-
[Basic Useage Examples](#basic-useage-examples)
18
+
## [Examples](#basic-useage-examples)
20
19
21
-
## Servers and Requests
20
+
## [Servers & Requests](#servers-and-requests)
22
21
[The Server Instance](#api)
23
22
24
23
[Model Requests](#modelrequest)
25
24
26
25
[File Upload Requests](#fileuploadrequest)
27
26
28
27
[Bulletin Order Requests](#bulletinorderrequest)
29
-
## Models
28
+
## [Carousel Models](#models)
30
29
[Templates](#template)
31
30
32
31
[Bulletins](#bulletin)
@@ -41,6 +40,8 @@ composer install trms/carousel
41
40
42
41
[Bulletin Sorting](#bulletin-sorting)
43
42
43
+
## [Thrown Exceptions](#exceptions)
44
+
44
45
## Basic Useage Examples
45
46
46
47
### Creating a server instance
@@ -152,15 +153,18 @@ Bulletin order requests are used to get the Group/Bulletin order for a given Zon
152
153
|constructor|associative array|Request Object|Pass this an associative array of values to filter the request with. (ie:['ZoneID'=>'5'])|
153
154
154
155
## Models
155
-
156
+
|Method|Parameters|Returns|Description|
157
+
|------|----------|-------|-----------|
158
+
|constructor|associative array|self|Constructor for the class, properties passed to it will be used to define the Model.|
159
+
|save|none|none|This is a convenience method for saving previously persisted models. For newly instantiated models this function will throw a `CarouselModelException`. Use the API's `save` method to save new models.|
160
+
|delete|none|none|This is a convenience method for deleting previously persisted models. For newly instantiated models this function will throw a `CarouselModelException`.|
156
161
### Bulletin
157
162
`TRMS\Carousel\Models\Bulletin`
158
163
159
164
A Bulletin is a piece of content displayed in Carousel. The closest analogy would be a slide in a power point deck.
160
165
#### Methods
161
166
|Method|Parameters|Returns|Description|
162
167
|------|----------|-------|-----------|
163
-
|constructor|associative array|Zone Object|Constructor for the class, properties passed to it will be used to define the Bulletin.|
164
168
|fromTemplate (static)|Template Object|Bulletin Object|Create a new unsaved bulletin from a template.|
165
169
|resolvePartial|none|none|Resolves partial bulletins by getting them by id from the server. See the property `PartialBulletin` for more information. This function is called when trying to save partial bulletins.|
166
170
|**Relationships**|
@@ -224,7 +228,6 @@ A template is the starting point for a standard Bulletin and is comprised of a b
224
228
#### Methods
225
229
|Method|Parameters|Returns|Description|
226
230
|------|----------|-------|-----------|
227
-
|constructor|associative array|Zone Object|Constructor for the class, properties passed to it will be used to define the Template.|
228
231
|setBackground|Media Object|self - chainable|Sets the background Media to be used in this model|
229
232
|getBackground|none|Media Object|Gets the related background Media model|
230
233
|addBlock|Block Object|self - chainable|Add a Block relationship to the model|
@@ -252,7 +255,6 @@ A group is a container for Bulletins that allows for easier viewing sorting and
252
255
#### Methods
253
256
|Method|Parameters|Returns|Description|
254
257
|------|----------|-------|-----------|
255
-
|constructor|associative array|Group Object|Constructor for the class, properties passed to it will be used to define the Group.|
256
258
|setZone|Zone Object|self - chainable|Sets the Zone to be used in this model|
257
259
|getZone|none|Zone Object|Gets the related Zone model|
258
260
@@ -270,7 +272,6 @@ Media represents audio, video images and backgrounds to be used in Bulletins and
270
272
#### Methods
271
273
|Method|Parameters|Returns|Description|
272
274
|------|----------|-------|-----------|
273
-
|constructor|associative array|Media Object|Constructor for the class, properties passed to it will be used to define the Media.|
274
275
|setUser|User Object|self - chainable|Sets the User to be used in this model|
275
276
|getUser|none|User Object|Gets the related User model|
276
277
|addTag|Tag Object|self - chainable|Add a Tag relationship to the model.|
@@ -296,7 +297,6 @@ A Zone is an area of real estate on screen where bulletins are displayed. The s
296
297
#### Methods
297
298
|Method|Parameters|Returns|Description|
298
299
|------|----------|-------|-----------|
299
-
|constructor|associative array|Zone Object|Constructor for the class, properties passed to it will be used to define the Zone.|
300
300
|addTag|ZoneTag Object|self - chainable|Add a Tag relationship to the model|
301
301
|removeTag|ZoneTag Object|self - chainable|Remove a Tag relationship from the model|
302
302
#### Properties
@@ -326,9 +326,6 @@ Tags are metadata that can be added to the associated model. They are used for
326
326
### ZoneTag
327
327
`TRMS\Carousel\Models\ZoneTag`
328
328
#### Methods
329
-
|Method|Parameters|Returns|Description|
330
-
|------|----------|-------|-----------|
331
-
|constructor|associative array|BulletinTag Object|Constructor for the class, properties passed to it will be used to define the Tag.|
332
329
#### Properties
333
330
|Property|type|Description|
334
331
|--------|----|-----------|
@@ -356,3 +353,11 @@ This represents a Group and the order of its Bulletins. The order of the `Bulle
356
353
|--------|----|-----------|
357
354
|id|string|This is set by the server and not editable.|
358
355
|Bulletins|array|An ordered array of Bulletin ids. Their order represents the order of Bulletins in the Group.|
356
+
357
+
358
+
## Exceptions
359
+
You can expect the following exceptions to be thrown if things go off the rails with the server, or if you attepmpt to do things that are unsupported or not allowed.
0 commit comments