-
Notifications
You must be signed in to change notification settings - Fork 1
Open
Description
On L172 of Repofuck.php:
$this->entity = $this->entities->resolve($name);
When null is supplied as the first argument in entity() method of Repofuck, it'll probably return the value of first element of $entities since in L172, nothing is supplied as the 2nd argument. Assuming that $entities of Repofuck's $entities is not empty. So $repo->entity with have the first element resulted from resolve().
What if I want to do this?
- Use
entity()method:
$repo->entity('users', function($entity){
return $entity->with('posts');
});
//$repo->entity is now $entity->with($users); (An instanceof Builder)
- Append some method calls to the current
$entityofRepofuckwhich is now aBuilder,$repo->entitymust not be reset, the goal is that it must turn into:
$entity->with('posts')->whereIn([1,2,3]);
Metadata
Metadata
Assignees
Labels
No labels