@@ 356-367 (lines=12) @@ | ||
353 | * @param bool $merge Whether or not to merge new data with the current data when setting. |
|
354 | * @return $this|array Returns either the meta or `$this` when setting the meta data. |
|
355 | */ |
|
356 | public function meta($meta = null, $merge = false) { |
|
357 | if ($meta !== null) { |
|
358 | if ($merge) { |
|
359 | $this->meta = array_merge($this->meta, $meta); |
|
360 | } else { |
|
361 | $this->meta = $meta; |
|
362 | } |
|
363 | return $this; |
|
364 | } else { |
|
365 | return $this->meta; |
|
366 | } |
|
367 | } |
|
368 | ||
369 | /** |
|
370 | * Get or set the data for the response. |
|
@@ 376-387 (lines=12) @@ | ||
373 | * @param bool $merge Whether or not to merge new data with the current data when setting. |
|
374 | * @return Response|array Returns either the data or `$this` when setting the data. |
|
375 | */ |
|
376 | public function data($data = null, $merge = false) { |
|
377 | if ($data !== null) { |
|
378 | if ($merge) { |
|
379 | $this->data = array_merge($this->data, $data); |
|
380 | } else { |
|
381 | $this->data = $data; |
|
382 | } |
|
383 | return $this; |
|
384 | } else { |
|
385 | return $this->data; |
|
386 | } |
|
387 | } |
|
388 | ||
389 | /** |
|
390 | * Gets or sets headers. |