-
Notifications
You must be signed in to change notification settings - Fork 185
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
824e168
commit 4bd6dd1
Showing
2 changed files
with
107 additions
and
98 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,106 @@ | ||
<?php namespace App; | ||
|
||
use Illuminate\Database\Eloquent\Model; | ||
|
||
/** | ||
* Abstract class to hold the relationships for projects to stop PHPMD complaning | ||
* This seems like such a hacky way to structure it | ||
*/ | ||
abstract class ProjectRelation extends Model | ||
{ | ||
/** | ||
* Belongs to relationship | ||
* | ||
* @return Group | ||
*/ | ||
public function group() | ||
{ | ||
return $this->belongsTo('App\Group'); | ||
} | ||
|
||
/** | ||
* Has many relationship | ||
* | ||
* @return Server | ||
*/ | ||
public function servers() | ||
{ | ||
return $this->hasMany('App\Server')->orderBy('name'); | ||
} | ||
|
||
/** | ||
* Has many relationship | ||
* | ||
* @return Heartbeat | ||
*/ | ||
public function heartbeats() | ||
{ | ||
return $this->hasMany('App\Heartbeat')->orderBy('name'); | ||
} | ||
|
||
/** | ||
* Has many relationship | ||
* | ||
* @return Notification | ||
*/ | ||
public function notifications() | ||
{ | ||
return $this->hasMany('App\Notification')->orderBy('name'); | ||
} | ||
|
||
/** | ||
* Has many relationship | ||
* | ||
* @return Deployment | ||
*/ | ||
public function deployments() | ||
{ | ||
return $this->hasMany('App\Deployment')->orderBy('started_at', 'DESC'); | ||
} | ||
|
||
/** | ||
* Has many relationship | ||
* | ||
* @return Command | ||
*/ | ||
public function commands() | ||
{ | ||
return $this->hasMany('App\Command'); | ||
} | ||
|
||
/** | ||
* Has many relationship | ||
* @return SharedFile | ||
*/ | ||
public function shareFiles() | ||
{ | ||
return $this->hasMany('App\SharedFile'); | ||
} | ||
|
||
/** | ||
* Has many relationship to project file | ||
* @return ProjectFile | ||
*/ | ||
public function projectFiles() | ||
{ | ||
return $this->hasMany('App\ProjectFile'); | ||
} | ||
|
||
/** | ||
* Has many relationship | ||
* @return SharedFile | ||
*/ | ||
public function notifyEmails() | ||
{ | ||
return $this->hasMany('App\NotifyEmail'); | ||
} | ||
|
||
/** | ||
* Has many urls to check | ||
* @return CheckUrl | ||
*/ | ||
public function checkUrls() | ||
{ | ||
return $this->hasMany('App\CheckUrl'); | ||
} | ||
} |