MembersTrait
+ Inheritance diagram for MembersTrait:

Description

The resource has members.

Public Methods

$this addMember (User $user)
 
$this addMembers (array $users)
 
magic User[] getMembers ()
 
magic bool hasMembers ()
 
$this removeMember (User $user)
 
$this removeMembers (array $users)
 
magic User[] selectMembers (callable $filter)
 fn( User $user ): bool More...
 

Additional Inherited Members

- Protected Methods inherited from PostMutatorTrait
$this _addWithPost (string $addPath, array $postData, string $field, array $diff)
 For existing entities this adds references to other entities via the given POST path. More...
 
$this _removeWithPost (string $rmPath, array $postData, string $field, array|Closure $diff)
 For existing entities this removes references to other entities via the given POST path. More...
 

Methods

◆ addMember()

$this addMember ( User  $user)
Parameters
User$user
Returns
$this

◆ addMembers()

$this addMembers ( array  $users)
Parameters
User[]$users
Returns
$this

◆ getMembers()

magic User [] getMembers ( )
Returns
User[]

◆ hasMembers()

magic bool hasMembers ( )
Returns
bool

◆ removeMember()

$this removeMember ( User  $user)
Parameters
User$user
Returns
$this

◆ removeMembers()

$this removeMembers ( array  $users)
Parameters
User[]$users
Returns
$this

◆ selectMembers()

magic User [] selectMembers ( callable  $filter)

fn( User $user ): bool

Returns
User[]