1 | <?php |
||
11 | use Illuminate\Database\Eloquent\Model as BaseModel; |
||
12 | |||
13 | abstract class Model extends BaseModel |
||
14 | { |
||
15 | use CassandraTypesTrait; |
||
16 | |||
17 | /** |
||
18 | * The connection name for the model. |
||
19 | * |
||
20 | * @var string |
||
21 | */ |
||
22 | protected $connection = 'cassandra'; |
||
23 | |||
24 | /** |
||
25 | * Indicates if the IDs are auto-incrementing. |
||
26 | * This is not possible in cassandra so we override this |
||
27 | * |
||
28 | * @var bool |
||
29 | */ |
||
30 | public $incrementing = false; |
||
31 | |||
32 | /** |
||
33 | * @inheritdoc |
||
34 | */ |
||
35 | 55 | public function newEloquentBuilder($query) |
|
39 | |||
40 | /** |
||
41 | * @inheritdoc |
||
42 | */ |
||
43 | 55 | protected function newBaseQueryBuilder() |
|
49 | |||
50 | /** |
||
51 | * @inheritdoc |
||
52 | */ |
||
53 | 13 | public function freshTimestamp() |
|
57 | |||
58 | /** |
||
59 | * @inheritdoc |
||
60 | */ |
||
61 | 13 | public function fromDateTime($value) |
|
75 | |||
76 | /** |
||
77 | * @inheritdoc |
||
78 | */ |
||
79 | 6 | protected function asDateTime($value) |
|
88 | |||
89 | /** |
||
90 | * Get the table qualified key name. |
||
91 | * Cassandra does not support the table.column annotation so |
||
92 | * we override this |
||
93 | * |
||
94 | * @return string |
||
95 | */ |
||
96 | 8 | public function getQualifiedKeyName() |
|
100 | |||
101 | /** |
||
102 | * Qualify the given column name by the model's table. |
||
103 | * |
||
104 | * @param string $column |
||
105 | * @return string |
||
106 | */ |
||
107 | 2 | public function qualifyColumn($column) |
|
111 | |||
112 | /** |
||
113 | * @inheritdoc |
||
114 | */ |
||
115 | 55 | public function __call($method, $parameters) |
|
124 | |||
125 | /** |
||
126 | * Create a new Eloquent Collection instance. |
||
127 | * |
||
128 | * @param Rows|array $rows |
||
129 | * |
||
130 | * @return Collection |
||
131 | * |
||
132 | * @throws \Exception |
||
133 | */ |
||
134 | 50 | public function newCassandraCollection($rows) |
|
153 | |||
154 | /** |
||
155 | * Determine if the new and old values for a given key are equivalent. |
||
156 | * |
||
157 | * @param string $key |
||
158 | * @param mixed $current |
||
159 | * @return bool |
||
160 | */ |
||
161 | 13 | public function originalIsEquivalent($key, $current) |
|
162 | { |
||
163 | 13 | if (!array_key_exists($key, $this->original)) { |
|
205 |
This check looks for parameters that are defined as one type in their type hint or doc comment but seem to be used as a narrower type, i.e an implementation of an interface or a subclass.
Consider changing the type of the parameter or doing an instanceof check before assuming your parameter is of the expected type.