Subversion-Projekte lars-tiefland.laravel_shop

Revision

Details | Letzte Änderung | Log anzeigen | RSS feed

Revision Autor Zeilennr. Zeile
148 lars 1
<?php
2
 
3
namespace Illuminate\Contracts\Database;
4
 
5
class ModelIdentifier
6
{
7
    /**
8
     * The class name of the model.
9
     *
10
     * @var string
11
     */
12
    public $class;
13
 
14
    /**
15
     * The unique identifier of the model.
16
     *
17
     * This may be either a single ID or an array of IDs.
18
     *
19
     * @var mixed
20
     */
21
    public $id;
22
 
23
    /**
24
     * The relationships loaded on the model.
25
     *
26
     * @var array
27
     */
28
    public $relations;
29
 
30
    /**
31
     * The connection name of the model.
32
     *
33
     * @var string|null
34
     */
35
    public $connection;
36
 
37
    /**
38
     * The class name of the model collection.
39
     *
40
     * @var string|null
41
     */
42
    public $collectionClass;
43
 
44
    /**
45
     * Create a new model identifier.
46
     *
47
     * @param  string  $class
48
     * @param  mixed  $id
49
     * @param  array  $relations
50
     * @param  mixed  $connection
51
     * @return void
52
     */
53
    public function __construct($class, $id, array $relations, $connection)
54
    {
55
        $this->id = $id;
56
        $this->class = $class;
57
        $this->relations = $relations;
58
        $this->connection = $connection;
59
    }
60
 
61
    /**
62
     * Specify the collection class that should be used when serializing / restoring collections.
63
     *
64
     * @param  string|null  $collectionClass
65
     * @return $this
66
     */
67
    public function useCollectionClass(?string $collectionClass)
68
    {
69
        $this->collectionClass = $collectionClass;
70
 
71
        return $this;
72
    }
73
}