1 |
344b1e53
|
zabran
|
<?php
|
2 |
|
|
|
3 |
|
|
namespace App;
|
4 |
|
|
|
5 |
|
|
use Illuminate\Database\Eloquent\Model;
|
6 |
|
|
|
7 |
|
|
class Artefact extends Model
|
8 |
|
|
{
|
9 |
|
|
// Table Name
|
10 |
92577cfd
|
Marek Lovčí
|
protected $table = 'artefacts';
|
11 |
344b1e53
|
zabran
|
// Primary Key
|
12 |
92577cfd
|
Marek Lovčí
|
public $primaryKey = 'id';
|
13 |
344b1e53
|
zabran
|
|
14 |
|
|
/**
|
15 |
|
|
* Indicates if the model should be timestamped.
|
16 |
|
|
*
|
17 |
|
|
* @var bool
|
18 |
|
|
*/
|
19 |
|
|
public $timestamps = false;
|
20 |
|
|
|
21 |
|
|
/**
|
22 |
|
|
* Get the metadata for the artefact.
|
23 |
|
|
*/
|
24 |
|
|
public function metadata()
|
25 |
|
|
{
|
26 |
|
|
return $this->hasMany('App\Metadata');
|
27 |
|
|
}
|
28 |
|
|
|
29 |
dc0fb924
|
zabran
|
/**
|
30 |
43bb92a9
|
zabran
|
* Get the categories for the artefact.
|
31 |
dc0fb924
|
zabran
|
*/
|
32 |
43bb92a9
|
zabran
|
public function categories()
|
33 |
dc0fb924
|
zabran
|
{
|
34 |
43bb92a9
|
zabran
|
return $this->belongsToMany('App\Category');
|
35 |
dc0fb924
|
zabran
|
}
|
36 |
|
|
|
37 |
344b1e53
|
zabran
|
/**
|
38 |
43bb92a9
|
zabran
|
* Get the users for the artefact.
|
39 |
344b1e53
|
zabran
|
*/
|
40 |
43bb92a9
|
zabran
|
public function users()
|
41 |
344b1e53
|
zabran
|
{
|
42 |
43bb92a9
|
zabran
|
return $this->belongsToMany('App\User');
|
43 |
344b1e53
|
zabran
|
}
|
44 |
|
|
}
|