Completed
Push — master ( 988498...4210f3 )
by Manel
06:18
created

Enrollment   A

Complexity

Total Complexity 2

Size/Duplication

Total Lines 40
Duplicated Lines 0 %

Coupling/Cohesion

Components 0
Dependencies 3

Test Coverage

Coverage 0%

Importance

Changes 6
Bugs 0 Features 0
Metric Value
wmc 2
lcom 0
cbo 3
dl 0
loc 40
rs 10
c 6
b 0
f 0
ccs 0
cts 8
cp 0

2 Methods

Rating   Name   Duplication   Size   Complexity  
A user() 0 4 1
A classroom() 0 4 1
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\Events\EnrollmentCreated;
9
use Scool\EnrollmentMobile\Traits\RecordsActivity;
10
use Illuminate\Database\Eloquent\Model;
11
use Prettus\Repository\Contracts\Transformable;
12
use Prettus\Repository\Traits\TransformableTrait;
13
use Scool\Foundation\User;
14
15
/**
16
 * Class Enrollment
17
 * @package App\Entities
18
 */
19
class Enrollment extends Model implements Transformable
20
{
21
    //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
22
    use TransformableTrait,Nameable, RecordsActivity;//StatefulTrait;
23
24
    //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...
25
    //all camps
26
    protected $fillable = ['id','name','validated','finished','study_id','course_id','classroom_id'];
27
    //TODO: mirar estats (enrollment). Implementar i definir estats(exemple porta(esborrany,valida,feta).
28
    //TODO: Necessari vàlid i no.
29
    //TODO: Afegir rutes minim a un Model.
30
31
    protected $events = [
32
        'created' => EnrollmentCreated::class
33
    ];
34
35
    /**
36
     * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
37
     */
38
    public function user()
39
    {
40
        return $this->belongsTo(User::class, 'user_id');
41
    }
42
43
    /**
44
     * @return \Illuminate\Database\Eloquent\Relations\HasOne
45
     */
46
    public function classroom()
47
    {
48
        return $this->hasOne("Scool\EnrollmentMobile\Models\Classroom");
49
    }
50
51
//    /**
0 ignored issues
show
Unused Code Comprehensibility introduced by
38% 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...
52
//     * @return \Illuminate\Database\Eloquent\Relations\HasOne
53
//     */
54
//    public function enrollment()
55
//    {
56
//        return $this->hasOne("Scool\EnrollmentMobile\Classroom");
57
//    }
58
}
59