Subversion-Projekte lars-tiefland.laravel_shop

Revision

Revision 148 | Zur aktuellen Revision | Details | Vergleich mit vorheriger | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Database\Eloquent\Casts;
4
 
5
use ArrayObject as BaseArrayObject;
6
use Illuminate\Contracts\Support\Arrayable;
7
use JsonSerializable;
8
 
399 lars 9
/**
10
 * @template TKey of array-key
11
 * @template TItem
12
 * @extends  \ArrayObject<TKey, TItem>
13
 */
148 lars 14
class ArrayObject extends BaseArrayObject implements Arrayable, JsonSerializable
15
{
16
    /**
17
     * Get a collection containing the underlying array.
18
     *
19
     * @return \Illuminate\Support\Collection
20
     */
21
    public function collect()
22
    {
23
        return collect($this->getArrayCopy());
24
    }
25
 
26
    /**
27
     * Get the instance as an array.
28
     *
29
     * @return array
30
     */
31
    public function toArray()
32
    {
33
        return $this->getArrayCopy();
34
    }
35
 
36
    /**
37
     * Get the array that should be JSON serialized.
38
     *
39
     * @return array
40
     */
41
    public function jsonSerialize(): array
42
    {
43
        return $this->getArrayCopy();
44
    }
45
}