PHP Class app\models\Interaction

Inheritance: extends Jenssegers\Mongodb\Model
Show file Open project: phanan/koel Class Usage Examples

Protected Properties

Property Type Description
$casts
$guarded
$hidden

Public Methods

Method Description
batchLike ( array $songIds, User $user ) : array Like several songs at once.
batchUnlike ( array $songIds, User $user ) : integer Unlike several songs at once.
increasePlayCount ( string $songId, User $user ) : Interaction Increase the number of times a song is played by a user.
song ( )
toggleLike ( string $songId, User $user ) : Interaction Like or unlike a song on behalf of a user.
user ( )

Method Details

batchLike() public static method

Like several songs at once.
public static batchLike ( array $songIds, User $user ) : array
$songIds array
$user User
return array

batchUnlike() public static method

Unlike several songs at once.
public static batchUnlike ( array $songIds, User $user ) : integer
$songIds array
$user User
return integer

increasePlayCount() public static method

Increase the number of times a song is played by a user.
public static increasePlayCount ( string $songId, User $user ) : Interaction
$songId string
$user User
return Interaction

song() public method

public song ( )

toggleLike() public static method

Like or unlike a song on behalf of a user.
public static toggleLike ( string $songId, User $user ) : Interaction
$songId string
$user User
return Interaction

user() public method

public user ( )

Property Details

$casts protected property

protected $casts

$guarded protected property

protected $guarded

$hidden protected property

protected $hidden