Skip to content

Commit

Permalink
update phpdoc property
Browse files Browse the repository at this point in the history
  • Loading branch information
wit3 authored Mar 2, 2023
1 parent fe1b86e commit 9b2d828
Showing 1 changed file with 12 additions and 4 deletions.
16 changes: 12 additions & 4 deletions src/ModelLock.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,16 @@

/**
* @package sofa/model-locking
* @author Jarek Tkaczyk <[email protected]>
* @link https://github.com/jarektkaczyk/model-locking
* @author wit3 <[email protected]>
* @link https://github.com/wit3/model-locking
*
* @property string $model_type
* @property int $model_id
* @property string $token
* @property Carbon $locked_until
* @property ?int $user_id
* @property ?Carbon $created_at
* @property ?Carbon $updated_at
*/
class ModelLock extends Model
{
Expand All @@ -28,7 +36,7 @@ protected static function boot()
{
parent::boot();

static::saving(function ($lock) {
static::saving(function (self $lock) {
if (!$lock->isDirty('locked_until')) {
$lock->locked_until = $lock->lockTimestamp();
}
Expand All @@ -42,7 +50,7 @@ protected static function boot()
}
});

static::deleted(function ($lock) {
static::deleted(function (self $lock) {
if ($lock->model && $events = $lock->getEventDispatcher()) {
$events->dispatch(new ModelUnlocked($lock->model));
}
Expand Down

0 comments on commit 9b2d828

Please sign in to comment.