LeagueTeam::league()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 2

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 0
CRAP Score 2

Importance

Changes 0
Metric Value
dl 0
loc 3
ccs 0
cts 2
cp 0
rs 10
c 0
b 0
f 0
cc 1
eloc 2
nc 1
nop 0
crap 2
1
<?php
2
3
/**
4
 * LeagueTeam
5
 *
6
 * @property integer        $id
7
 * @property integer        $league_id
8
 * @property string         $name
9
 * @property \Carbon\Carbon $created_at
10
 * @property \Carbon\Carbon $updated_at
11
 * @method static \Illuminate\Database\Query\Builder|\LeagueTeam whereId($value)
12
 * @method static \Illuminate\Database\Query\Builder|\LeagueTeam whereLeagueId($value)
13
 * @method static \Illuminate\Database\Query\Builder|\LeagueTeam whereName($value)
14
 * @method static \Illuminate\Database\Query\Builder|\LeagueTeam whereCreatedAt($value)
15
 * @method static \Illuminate\Database\Query\Builder|\LeagueTeam whereUpdatedAt($value)
16
 * @property-read \League   $league
17
 * @property-read \Illuminate\Database\Eloquent\Collection|\User[] $users
18
 * @property-read \Illuminate\Database\Eloquent\Collection|\LeagueMovie[] $movies
19
 */
20
class LeagueTeam extends Eloquent {
0 ignored issues
show
Coding Style Compatibility introduced by
PSR1 recommends that each class must be in a namespace of at least one level to avoid collisions.

You can fix this by adding a namespace to your class:

namespace YourVendor;

class YourClass { }

When choosing a vendor namespace, try to pick something that is not too generic to avoid conflicts with other libraries.

Loading history...
21
22
	protected $fillable = ['name'];
23
24
	/**
25
	 * The league this team is in
26
	 *
27
	 * @return \Illuminate\Database\Eloquent\Relations\BelongsTo
28
	 */
29
	public function league() {
30
		return $this->belongsTo('League');
31
	}
32
33
	/**
34
	 * The users that are in this team
35
	 *
36
	 * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
37
	 */
38 9
	public function users() {
39 9
		return $this->belongsToMany('User')->withTimestamps();
40
	}
41
42
	/**
43
	 * The movies this team owns
44
	 *
45
	 * @return \Illuminate\Database\Eloquent\Relations\BelongsToMany
46
	 */
47 9
	public function movies() {
48 9
		return $this->belongsToMany('LeagueMovie', 'league_team_movies')->withTimestamps();
49
	}
50
}