Projekt

Obecné

Profil

Stáhnout (825 Bajtů) Statistiky
| Větev: | Tag: | Revize:
1 344b1e53 zabran
<?php
2
3
namespace App;
4
5
use Illuminate\Database\Eloquent\Model;
6
7
class Metadata extends Model
8
{
9
    // Table Name
10
    protected $table = 'metadata';//same name could make problems
11
    // Primary Key
12
    public $primaryKey = 'id';//unnecessery?
13
14
    /**
15
     * The model's default values for attributes.
16
     *
17
     * @var array
18
     */
19 43bb92a9 zabran
    /*protected $attributes = [
20 344b1e53 zabran
        'likes' => 0,
21 43bb92a9 zabran
    ];*/
22 344b1e53 zabran
23
    /**
24
     * Indicates if the model should be timestamped.
25
     *
26
     * @var bool
27
     */
28
    public $timestamps = false;
29
30
    /**
31 10222730 Adam Mištera
     * Get the artefact for this single metadata.
32 344b1e53 zabran
     */
33
    public function artefact(){
34
        return $this->belongsTo('App\Artefact');
35
    }
36
37 01b004be zabran
    /**
38
     * Get the users for the metadata.
39
     */
40
    public function users()
41
    {
42
        return $this->belongsToMany('App\User');
43
    }
44 344b1e53 zabran
}