FollowersTrait
+ Inheritance diagram for FollowersTrait:

Description

The resource has followers that can only be changed via POST.

Public Methods

$this addFollower (User $user)
 
$this addFollowers (array $users)
 
magic User[] getFollowers ()
 
magic bool hasFollowers ()
 
$this removeFollower (User $user)
 
$this removeFollowers (array $users)
 
magic User[] selectFollowers (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

◆ addFollower()

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

◆ addFollowers()

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

◆ getFollowers()

magic User [] getFollowers ( )
Returns
User[]

◆ hasFollowers()

magic bool hasFollowers ( )
Returns
bool

◆ removeFollower()

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

◆ removeFollowers()

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

◆ selectFollowers()

magic User [] selectFollowers ( callable  $filter)

fn( User $user ): bool

Returns
User[]