Skip to content

Commit 50bc96b

Browse files
committed
mongodb#1930 update parameter type
1 parent 2e47856 commit 50bc96b

File tree

3 files changed

+12
-5
lines changed

3 files changed

+12
-5
lines changed

Diff for: src/Relations/EmbedsMany.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -195,9 +195,11 @@ public function destroy($ids = [])
195195
/**
196196
* Delete all embedded models.
197197
*
198+
* @param null $id
199+
*
198200
* @return int
199201
*/
200-
public function delete()
202+
public function delete($id = null)
201203
{
202204
// Overwrite the local key with an empty array.
203205
$result = $this->query->update([$this->localKey => []]);

Diff for: src/Relations/EmbedsOne.php

+3-1
Original file line numberDiff line numberDiff line change
@@ -133,9 +133,11 @@ public function dissociate()
133133
/**
134134
* Delete all embedded models.
135135
*
136+
* @param ?string $id
137+
*
136138
* @return int
137139
*/
138-
public function delete()
140+
public function delete($id = null)
139141
{
140142
return $this->performDelete();
141143
}

Diff for: src/Relations/EmbedsOneOrMany.php

+6-3
Original file line numberDiff line numberDiff line change
@@ -8,6 +8,7 @@
88
use Illuminate\Database\Eloquent\Collection;
99
use Illuminate\Database\Eloquent\Model as EloquentModel;
1010
use Illuminate\Database\Eloquent\Relations\Relation;
11+
use Illuminate\Database\Query\Expression;
1112
use MongoDB\Laravel\Eloquent\Model;
1213

1314
use function array_merge;
@@ -103,9 +104,11 @@ public function get($columns = ['*'])
103104
/**
104105
* Get the number of embedded models.
105106
*
107+
* @param Expression|string $columns
108+
*
106109
* @return int
107110
*/
108-
public function count()
111+
public function count($columns = '*')
109112
{
110113
return count($this->getEmbedded());
111114
}
@@ -396,8 +399,8 @@ public function getQualifiedForeignKeyName()
396399
/**
397400
* Get the name of the "where in" method for eager loading.
398401
*
399-
* @param \Illuminate\Database\Eloquent\Model $model
400-
* @param string $key
402+
* @param EloquentModel $model
403+
* @param string $key
401404
*
402405
* @return string
403406
*/

0 commit comments

Comments
 (0)