From cf5adfad2597df2cfd64affc23736c6594c9a733 Mon Sep 17 00:00:00 2001 From: Jeramy Simpson Date: Mon, 23 Mar 2015 16:52:01 +1000 Subject: [PATCH] Namespace Updates and Confide Changes --- app/Http/Controllers/AppController.php | 1 + app/Http/Controllers/HomeController.php | 1 + app/Http/Controllers/UserController.php | 3 ++ app/Http/Middleware/StartupCheck.php | 3 ++ app/Models/Account.php | 26 +++++++++-------- app/Models/Activity.php | 2 +- app/Models/Invitation.php | 2 +- app/Models/Invoice.php | 2 +- app/Models/Project.php | 2 +- app/Models/ProjectCode.php | 2 +- app/Models/Timesheet.php | 2 +- app/Models/TimesheetEvent.php | 2 +- app/Models/TimesheetEventSource.php | 2 +- app/Models/User.php | 30 +++++++++++++++----- app/Ninja/Repositories/AccountRepository.php | 8 +++--- composer.json | 15 ++++++++++ 16 files changed, 72 insertions(+), 31 deletions(-) diff --git a/app/Http/Controllers/AppController.php b/app/Http/Controllers/AppController.php index d701f35daa7d..71263647f1af 100644 --- a/app/Http/Controllers/AppController.php +++ b/app/Http/Controllers/AppController.php @@ -10,6 +10,7 @@ use Utils; use View; use Ninja\Mailers\Mailer; use Ninja\Repositories\AccountRepository; +use Redirect; class AppController extends BaseController { diff --git a/app/Http/Controllers/HomeController.php b/app/Http/Controllers/HomeController.php index 14a1c17a8d11..983bd88897de 100644 --- a/app/Http/Controllers/HomeController.php +++ b/app/Http/Controllers/HomeController.php @@ -3,6 +3,7 @@ use App\Libraries\Utils; use Ninja\Mailers\Mailer; use Redirect; +use App\Models\Account; class HomeController extends BaseController { diff --git a/app/Http/Controllers/UserController.php b/app/Http/Controllers/UserController.php index a721970748dd..81d9ee6e23f2 100644 --- a/app/Http/Controllers/UserController.php +++ b/app/Http/Controllers/UserController.php @@ -1,5 +1,8 @@ hasMany('User'); + return $this->hasMany('App\Models\User'); } public function clients() { - return $this->hasMany('Client'); + return $this->hasMany('App\Models\Client'); } public function invoices() { - return $this->hasMany('Invoice'); + return $this->hasMany('App\Models\Invoice'); } public function account_gateways() { - return $this->hasMany('AccountGateway'); + return $this->hasMany('App\Models\AccountGateway'); } public function tax_rates() { - return $this->hasMany('TaxRate'); + return $this->hasMany('App\Models\TaxRate'); } public function country() { - return $this->belongsTo('Country'); + return $this->belongsTo('App\Models\Country'); } public function timezone() { - return $this->belongsTo('Timezone'); + return $this->belongsTo('App\Models\Timezone'); } public function language() { - return $this->belongsTo('Language'); + return $this->belongsTo('App\Models\Language'); } public function date_format() { - return $this->belongsTo('DateFormat'); + return $this->belongsTo('App\Models\DateFormat'); } public function datetime_format() { - return $this->belongsTo('DatetimeFormat'); + return $this->belongsTo('App\Models\DatetimeFormat'); } public function size() { - return $this->belongsTo('Size'); + return $this->belongsTo('App\Models\Size'); } public function industry() { - return $this->belongsTo('Industry'); + return $this->belongsTo('App\Models\Industry'); } public function isGatewayConfigured($gatewayId = 0) diff --git a/app/Models/Activity.php b/app/Models/Activity.php index 23c248de084f..4b06532845a8 100644 --- a/app/Models/Activity.php +++ b/app/Models/Activity.php @@ -17,7 +17,7 @@ class Activity extends Eloquent public function user() { - return $this->belongsTo('User'); + return $this->belongsTo('App\Models\User'); } private static function getBlank($entity = false) diff --git a/app/Models/Invitation.php b/app/Models/Invitation.php index dc0ea2c46f56..ef0a537535ec 100644 --- a/app/Models/Invitation.php +++ b/app/Models/Invitation.php @@ -14,7 +14,7 @@ class Invitation extends EntityModel public function user() { - return $this->belongsTo('User')->withTrashed(); + return $this->belongsTo('App\Models\User')->withTrashed(); } public function account() diff --git a/app/Models/Invoice.php b/app/Models/Invoice.php index fc3699b0e83e..f93832e599e1 100644 --- a/app/Models/Invoice.php +++ b/app/Models/Invoice.php @@ -9,7 +9,7 @@ class Invoice extends EntityModel public function user() { - return $this->belongsTo('User'); + return $this->belongsTo('App\Models\User'); } public function client() diff --git a/app/Models/Project.php b/app/Models/Project.php index 79cf9bf8ce09..f3ecdf3f18fa 100644 --- a/app/Models/Project.php +++ b/app/Models/Project.php @@ -15,7 +15,7 @@ class Project extends Eloquent public function user() { - return $this->belongsTo('User'); + return $this->belongsTo('App\Models\User'); } public function client() diff --git a/app/Models/ProjectCode.php b/app/Models/ProjectCode.php index c1a999f88ca7..17531449bf8d 100644 --- a/app/Models/ProjectCode.php +++ b/app/Models/ProjectCode.php @@ -15,7 +15,7 @@ class ProjectCode extends Eloquent public function user() { - return $this->belongsTo('User'); + return $this->belongsTo('App\Models\User'); } public function project() diff --git a/app/Models/Timesheet.php b/app/Models/Timesheet.php index bb946305d817..c1739c6547bd 100644 --- a/app/Models/Timesheet.php +++ b/app/Models/Timesheet.php @@ -12,7 +12,7 @@ class Timesheet extends Eloquent public function user() { - return $this->belongsTo('User'); + return $this->belongsTo('App\Models\User'); } public function timesheet_events() diff --git a/app/Models/TimesheetEvent.php b/app/Models/TimesheetEvent.php index d668968687bb..33f8e39c5746 100644 --- a/app/Models/TimesheetEvent.php +++ b/app/Models/TimesheetEvent.php @@ -27,7 +27,7 @@ class TimesheetEvent extends Eloquent public function user() { - return $this->belongsTo('User'); + return $this->belongsTo('App\Models\User'); } public function source() diff --git a/app/Models/TimesheetEventSource.php b/app/Models/TimesheetEventSource.php index 52c64a58014e..2f82b3c6b6e4 100644 --- a/app/Models/TimesheetEventSource.php +++ b/app/Models/TimesheetEventSource.php @@ -15,7 +15,7 @@ class TimesheetEventSource extends Eloquent public function user() { - return $this->belongsTo('User'); + return $this->belongsTo('App\Models\User'); } public function events() diff --git a/app/Models/User.php b/app/Models/User.php index 86c5aeda0e21..27dd24e1a04a 100644 --- a/app/Models/User.php +++ b/app/Models/User.php @@ -1,14 +1,25 @@