2022-08-17 09:39:53 -04:00
|
|
|
<?php
|
|
|
|
|
|
|
|
namespace BookStack\References;
|
|
|
|
|
|
|
|
use Illuminate\Database\Eloquent\Model;
|
|
|
|
use Illuminate\Database\Eloquent\Relations\MorphTo;
|
|
|
|
|
|
|
|
/**
|
2022-08-29 12:46:41 -04:00
|
|
|
* @property int $from_id
|
2022-08-17 09:39:53 -04:00
|
|
|
* @property string $from_type
|
2022-08-29 12:46:41 -04:00
|
|
|
* @property int $to_id
|
2022-08-17 09:39:53 -04:00
|
|
|
* @property string $to_type
|
|
|
|
*/
|
|
|
|
class Reference extends Model
|
|
|
|
{
|
2022-08-17 12:37:27 -04:00
|
|
|
public $timestamps = false;
|
|
|
|
|
2022-08-17 09:39:53 -04:00
|
|
|
public function from(): MorphTo
|
|
|
|
{
|
|
|
|
return $this->morphTo('from');
|
|
|
|
}
|
|
|
|
|
|
|
|
public function to(): MorphTo
|
|
|
|
{
|
|
|
|
return $this->morphTo('to');
|
|
|
|
}
|
|
|
|
}
|