Completed
Push — master ( eaebda...a73821 )
by Manel
02:56
created

Enrollment::user()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 4
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 4
ccs 0
cts 4
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
namespace Scool\EnrollmentMobile\Models;
4
5
use Acacha\Names\Traits\Nameable;
6
7
use Acacha\Stateful\Traits\StatefulTrait;
8
use Scool\EnrollmentMobile\Traits\RecordsActivity;
9
use Illuminate\Database\Eloquent\Model;
10
use Prettus\Repository\Contracts\Transformable;
11
use Prettus\Repository\Traits\TransformableTrait;
12
use Scool\Foundation\User;
13
14
/**
15
 * Class Enrollment
16
 * @package App\Entities
17
 */
18
class Enrollment extends Model implements Transformable
19
{
20
    //afegim model stateful per als models que volem qeu tinguin estat, com en el name per als noms. Afegir columna state ala migracio de l'objecte(i ens dira com esta l'objecte de la taula(open,closed,etc), es configurable. state amb nullabel si pot ser que no es guarde
21
    use TransformableTrait,Nameable, RecordsActivity;//StatefulTrait;
22
23
    //public $timestamps = false;
0 ignored issues
show
Unused Code Comprehensibility introduced by
50% of this comment could be valid code. Did you maybe forget this after debugging?

Sometimes obsolete code just ends up commented out instead of removed. In this case it is better to remove the code once you have checked you do not need it.

The code might also have been commented out for debugging purposes. In this case it is vital that someone uncomments it again or your project may behave in very unexpected ways in production.

This check looks for comments that seem to be mostly valid code and reports them.

Loading history...
24
    //all camps
25
    protected $fillable = ['id','name','validated','finished','study_id','course_id','classroom_id'];
26
    //TODO: mirar estats (enrollment). Implementar i definir estats(exemple porta(esborrany,valida,feta).
27
    //TODO: Necessari vàlid i no.
28
    //TODO: Afegir rutes minim a un Model.
29
30
    /**
31
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
32
     */
33
    public function user()
34
    {
35
        return $this->belongsTo(User::class, 'user_id');
36
    }
37
}
38