| 1 |
<?php |
| 2 |
namespace Depicter\Database\Entity; |
| 3 |
|
| 4 |
use Averta\WordPress\Database\Entity\Model; |
| 5 |
|
| 6 |
class Meta extends Model |
| 7 |
{ |
| 8 |
/** |
| 9 |
* Resource name. |
| 10 |
* |
| 11 |
* @var string |
| 12 |
*/ |
| 13 |
protected $resource = 'depicter_meta'; |
| 14 |
|
| 15 |
/** |
| 16 |
* Determines what fields can be saved without be explicitly. |
| 17 |
* |
| 18 |
* @var array |
| 19 |
*/ |
| 20 |
protected $builtin = [ |
| 21 |
'relation', |
| 22 |
'relation_id', |
| 23 |
'meta_key', |
| 24 |
'meta_value' |
| 25 |
]; |
| 26 |
|
| 27 |
protected $guard = [ 'id' ]; |
| 28 |
|
| 29 |
public function document() |
| 30 |
{ |
| 31 |
return $this->belongsTo(Document::class, 'relation_id', 'id'); |
| 32 |
} |
| 33 |
} |
| 34 |
|