Skip to content

Commit d2d06c2

Browse files
committed
#1930 update parameter type
1 parent b34049b commit d2d06c2

File tree

3 files changed

+15
-7
lines changed

3 files changed

+15
-7
lines changed

src/Relations/EmbedsMany.php

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,7 @@
99
use Illuminate\Pagination\LengthAwarePaginator;
1010
use Illuminate\Pagination\Paginator;
1111
use MongoDB\BSON\ObjectID;
12+
use MongoDB\Laravel\Eloquent\Model as MongoDBModel;
1213

1314
use function array_key_exists;
1415
use function array_values;
@@ -195,9 +196,11 @@ public function destroy($ids = [])
195196
/**
196197
* Delete all embedded models.
197198
*
199+
* @param null $id
200+
*
198201
* @return int
199202
*/
200-
public function delete()
203+
public function delete($id = null)
201204
{
202205
// Overwrite the local key with an empty array.
203206
$result = $this->query->update([$this->localKey => []]);
@@ -224,9 +227,9 @@ public function detach($ids = [])
224227
/**
225228
* Save alias.
226229
*
227-
* @return Model
230+
* @return MongoDBModel
228231
*/
229-
public function attach(Model $model)
232+
public function attach(MongoDBModel $model)
230233
{
231234
return $this->save($model);
232235
}

src/Relations/EmbedsOne.php

Lines changed: 3 additions & 1 deletion
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
}

src/Relations/EmbedsOneOrMany.php

Lines changed: 6 additions & 3 deletions
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;
@@ -98,9 +99,11 @@ public function get($columns = ['*'])
9899
/**
99100
* Get the number of embedded models.
100101
*
102+
* @param Expression|string $columns
103+
*
101104
* @return int
102105
*/
103-
public function count()
106+
public function count($columns = '*')
104107
{
105108
return count($this->getEmbedded());
106109
}
@@ -391,8 +394,8 @@ public function getQualifiedForeignKeyName()
391394
/**
392395
* Get the name of the "where in" method for eager loading.
393396
*
394-
* @param \Illuminate\Database\Eloquent\Model $model
395-
* @param string $key
397+
* @param EloquentModel $model
398+
* @param string $key
396399
*
397400
* @return string
398401
*/

0 commit comments

Comments
 (0)