| @@ 83-92 (lines=10) @@ | ||
| 80 | * |
|
| 81 | * @return $this |
|
| 82 | */ |
|
| 83 | public function collection($data, $transformer = null, $resourceName = null) |
|
| 84 | { |
|
| 85 | $this->resourceName = $resourceName; |
|
| 86 | ||
| 87 | if ($transformer) { |
|
| 88 | $this->transformWith($transformer); |
|
| 89 | } |
|
| 90 | ||
| 91 | return $this->data('collection', $data, $transformer); |
|
| 92 | } |
|
| 93 | ||
| 94 | /** |
|
| 95 | * Set the item data that must be transformed. |
|
| @@ 103-112 (lines=10) @@ | ||
| 100 | * |
|
| 101 | * @return $this |
|
| 102 | */ |
|
| 103 | public function item($data, $transformer = null, $resourceName = null) |
|
| 104 | { |
|
| 105 | $this->resourceName = $resourceName; |
|
| 106 | ||
| 107 | if ($transformer) { |
|
| 108 | $this->transformWith($transformer); |
|
| 109 | } |
|
| 110 | ||
| 111 | return $this->data('item', $data, $transformer); |
|
| 112 | } |
|
| 113 | ||
| 114 | /** |
|
| 115 | * Set the data that must be transformed. |
|