2015-12-09 14:50:17 -05:00
|
|
|
<?php namespace BookStack;
|
|
|
|
|
2018-09-25 07:30:50 -04:00
|
|
|
use BookStack\Auth\User;
|
|
|
|
|
2020-05-01 18:24:11 -04:00
|
|
|
/**
|
|
|
|
* @property int created_by
|
|
|
|
* @property int updated_by
|
|
|
|
*/
|
2016-02-27 14:24:42 -05:00
|
|
|
abstract class Ownable extends Model
|
2015-12-09 14:50:17 -05:00
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Relation for the user that created this entity.
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
*/
|
|
|
|
public function createdBy()
|
|
|
|
{
|
2016-05-01 16:20:50 -04:00
|
|
|
return $this->belongsTo(User::class, 'created_by');
|
2015-12-09 14:50:17 -05:00
|
|
|
}
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Relation for the user that updated this entity.
|
|
|
|
* @return \Illuminate\Database\Eloquent\Relations\BelongsTo
|
|
|
|
*/
|
|
|
|
public function updatedBy()
|
|
|
|
{
|
2016-05-01 16:20:50 -04:00
|
|
|
return $this->belongsTo(User::class, 'updated_by');
|
2015-12-09 14:50:17 -05:00
|
|
|
}
|
2016-02-27 14:24:42 -05:00
|
|
|
|
2018-01-28 11:58:52 -05:00
|
|
|
}
|