1 | <?php |
||
11 | class EloquentPresenceVerifier extends DatabasePresenceVerifier |
||
12 | { |
||
13 | /** |
||
14 | * The eloquent model instance. |
||
15 | * |
||
16 | * @var \Illuminate\Database\Eloquent\Model |
||
17 | */ |
||
18 | protected $model; |
||
19 | |||
20 | /** |
||
21 | * Create a new eloquent presence verifier instance. |
||
22 | * |
||
23 | * @param \Illuminate\Database\ConnectionResolverInterface $db |
||
24 | * @param \Illuminate\Database\Eloquent\Model $model |
||
25 | * |
||
26 | * @return void |
||
|
|||
27 | */ |
||
28 | public function __construct(ConnectionResolverInterface $db, Model $model) |
||
34 | |||
35 | /** |
||
36 | * Count the number of objects in a collection having the given value. |
||
37 | * |
||
38 | * @param string $collection |
||
39 | * @param string $column |
||
40 | * @param string $value |
||
41 | * @param int|null $excludeId |
||
42 | * @param string|null $idColumn |
||
43 | * @param array $extra |
||
44 | * |
||
45 | * @return int |
||
46 | */ |
||
47 | public function getCount($collection, $column, $value, $excludeId = null, $idColumn = null, array $extra = []) |
||
57 | |||
58 | /** |
||
59 | * Count the number of objects in a collection with the given values. |
||
60 | * |
||
61 | * @param string $collection |
||
62 | * @param string $column |
||
63 | * @param array $values |
||
64 | * @param array $extra |
||
65 | * |
||
66 | * @return int |
||
67 | */ |
||
68 | public function getMultiCount($collection, $column, array $values, array $extra = []) |
||
74 | |||
75 | /** |
||
76 | * @param $collection |
||
77 | * |
||
78 | * @return Model |
||
79 | */ |
||
80 | private function model($collection) |
||
84 | } |
||
85 |
Adding a
@return
annotation to a constructor is not recommended, since a constructor does not have a meaningful return value.Please refer to the PHP core documentation on constructors.