1 | <?php |
||
8 | class DuplicateOptions |
||
9 | { |
||
10 | /** |
||
11 | * The database columns that should be ignored when duplicating the record. |
||
12 | * |
||
13 | * @var array|string |
||
14 | */ |
||
15 | private $excludedColumns; |
||
16 | |||
17 | /** |
||
18 | * The database columns that should be unique when duplicating the record. |
||
19 | * |
||
20 | * @var array|string |
||
21 | */ |
||
22 | private $uniqueColumns; |
||
23 | |||
24 | /** |
||
25 | * The relations of the model that should be ignored when duplicating the record. |
||
26 | * |
||
27 | * @var array|string |
||
28 | */ |
||
29 | private $excludedRelations; |
||
30 | |||
31 | /** |
||
32 | * The database columns for each model's relation that should be ignored when duplicating the record. |
||
33 | * |
||
34 | * @var array |
||
35 | */ |
||
36 | private $excludedRelationColumns; |
||
37 | |||
38 | /** |
||
39 | * The database columns for each model's relation that should be unique when duplicating the record. |
||
40 | * |
||
41 | * @var array |
||
42 | */ |
||
43 | private $uniqueRelationColumns; |
||
44 | |||
45 | /** |
||
46 | * Flag indicating if when duplicating a record, the script should also duplicate it's relations. |
||
47 | * |
||
48 | * @var bool |
||
49 | */ |
||
50 | private $shouldDuplicateDeeply = true; |
||
51 | |||
52 | /** |
||
53 | * Get the value of a property of this class. |
||
54 | * |
||
55 | * @param $name |
||
56 | * @return mixed |
||
57 | * @throws Exception |
||
58 | */ |
||
59 | public function __get($name) |
||
69 | |||
70 | /** |
||
71 | * Get a fresh instance of this class. |
||
72 | * |
||
73 | * @return DuplicateOptions |
||
74 | */ |
||
75 | public static function instance(): self |
||
79 | |||
80 | /** |
||
81 | * Set the $excludedColumns to work with in the Neurony\Duplicate\Traits\HasDuplicates trait. |
||
82 | * |
||
83 | * @param array|string $columns |
||
84 | * @return DuplicateOptions |
||
85 | */ |
||
86 | public function excludeColumns(...$columns): self |
||
92 | |||
93 | /** |
||
94 | * Set the $uniqueColumns to work with in the Neurony\Duplicate\Traits\HasDuplicates trait. |
||
95 | * |
||
96 | * @param array|string $columns |
||
97 | * @return DuplicateOptions |
||
98 | */ |
||
99 | public function uniqueColumns(...$columns): self |
||
105 | |||
106 | /** |
||
107 | * Set the $excludedRelations to work with in the Neurony\Duplicate\Traits\HasDuplicates trait. |
||
108 | * |
||
109 | * @param array|string $relations |
||
110 | * @return DuplicateOptions |
||
111 | */ |
||
112 | public function excludeRelations(...$relations): self |
||
118 | |||
119 | /** |
||
120 | * Set the $excludedRelationColumns to work with in the Neurony\Duplicate\Traits\HasDuplicates trait. |
||
121 | * |
||
122 | * Param $columns: |
||
123 | * --- associative array with keys containing each relation name and values (array) containing the excluded columns for each relation. |
||
124 | * |
||
125 | * @param array $columns |
||
126 | * @return DuplicateOptions |
||
127 | */ |
||
128 | public function excludeRelationColumns(array $columns = []): self |
||
134 | |||
135 | /** |
||
136 | * Set the $uniqueRelationColumns to work with in the Neurony\Duplicate\Traits\HasDuplicates trait. |
||
137 | * |
||
138 | * Param $columns: |
||
139 | * --- associative array with keys containing each relation name and values (array) containing the unique columns for each relation. |
||
140 | * |
||
141 | * @param array $columns |
||
142 | * @return DuplicateOptions |
||
143 | */ |
||
144 | public function uniqueRelationColumns(array $columns = []): self |
||
150 | |||
151 | /** |
||
152 | * Set the $shouldDuplicateDeeply to work with in the Neurony\Duplicate\Traits\HasDuplicates trait. |
||
153 | * |
||
154 | * @return DuplicateOptions |
||
155 | */ |
||
156 | public function disableDeepDuplication(): self |
||
162 | } |
||
163 |
It seems like the type of the argument is not accepted by the function/method which you are calling.
In some cases, in particular if PHP’s automatic type-juggling kicks in this might be fine. In other cases, however this might be a bug.
We suggest to add an explicit type cast like in the following example: