From 4bd6dd167ac6580b7ff123771a661b7476e02bb0 Mon Sep 17 00:00:00 2001 From: Stephen Ball Date: Sun, 31 May 2015 20:39:06 +0100 Subject: [PATCH] Re-adding ProjectRelation model --- app/Project.php | 99 +------------------------------------ app/ProjectRelation.php | 106 ++++++++++++++++++++++++++++++++++++++++ 2 files changed, 107 insertions(+), 98 deletions(-) create mode 100644 app/ProjectRelation.php diff --git a/app/Project.php b/app/Project.php index 7b2593f61..625a38aef 100644 --- a/app/Project.php +++ b/app/Project.php @@ -1,7 +1,6 @@ 'integer' ]; - /** - * 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'); - } - /** * Override the boot method to bind model event listeners * diff --git a/app/ProjectRelation.php b/app/ProjectRelation.php new file mode 100644 index 000000000..5df92ac19 --- /dev/null +++ b/app/ProjectRelation.php @@ -0,0 +1,106 @@ +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'); + } +} \ No newline at end of file