Convert string references to ::class

PHP 5.5.9 adds the new static `class` property which provides the fully qualified class name. This is preferred over using strings for class names since the `class` property references are checked by PHP.
This commit is contained in:
Shift
2023-01-03 08:25:43 +00:00
parent f9ab4d057e
commit 9a6f1788a4
15 changed files with 40 additions and 40 deletions

View File

@@ -15,7 +15,7 @@ class Organization extends BaseModel
public function userRelation()
{
$related = "App\Model\helpdesk\Agent_panel\User_org";
$related = \App\Model\helpdesk\Agent_panel\User_org::class;
return $this->hasMany($related, 'org_id');
}

View File

@@ -44,7 +44,7 @@ class Emails extends BaseModel
public function extraFieldRelation()
{
$related = "App\Model\MailJob\FaveoMail";
$related = \App\Model\MailJob\FaveoMail::class;
return $this->hasMany($related, 'email_id');
}

View File

@@ -17,7 +17,7 @@ class Fields extends BaseModel
public function valueRelation()
{
$related = "App\Model\helpdesk\Form\FieldValue";
$related = \App\Model\helpdesk\Form\FieldValue::class;
return $this->hasMany($related, 'field_id');
}

View File

@@ -17,7 +17,7 @@ class Forms extends BaseModel
public function fieldRelation()
{
$related = "App\Model\helpdesk\Form\Fields";
$related = \App\Model\helpdesk\Form\Fields::class;
return $this->hasMany($related);
}
@@ -41,7 +41,7 @@ class Forms extends BaseModel
public function formValueRelation()
{
$related = "App\Model\helpdesk\Form\FieldValue";
$related = \App\Model\helpdesk\Form\FieldValue::class;
return $this->hasMany($related, 'child_id');
}

View File

@@ -16,7 +16,7 @@ class Help_topic extends BaseModel
public function department()
{
$related = 'App\Model\helpdesk\Agent\Department';
$related = \App\Model\helpdesk\Agent\Department::class;
$foreignKey = 'department';
return $this->belongsTo($related, $foreignKey);

View File

@@ -15,7 +15,7 @@ class Notification extends BaseModel
public function type()
{
$related = 'App\Model\helpdesk\Notification\NotificationType';
$related = \App\Model\helpdesk\Notification\NotificationType::class;
$id = 'type_id';
return $this->belongsTo($related, $id);
@@ -23,7 +23,7 @@ class Notification extends BaseModel
public function model()
{
$related = 'App\Model\helpdesk\Ticket\Tickets';
$related = \App\Model\helpdesk\Ticket\Tickets::class;
$id = 'model_id';
return $this->belongsTo($related, $id);
@@ -31,7 +31,7 @@ class Notification extends BaseModel
public function userNotification()
{
$related = 'App\Model\helpdesk\Notification\UserNotification';
$related = \App\Model\helpdesk\Notification\UserNotification::class;
$foreignKey = 'notification_id';
return $this->hasMany($related, $foreignKey);

View File

@@ -15,7 +15,7 @@ class UserNotification extends BaseModel
public function notification()
{
$related = 'App\Model\helpdesk\Notification\Notification';
$related = \App\Model\helpdesk\Notification\Notification::class;
$id = 'notification_id';
return $this->belongsTo($related, $id);
@@ -23,7 +23,7 @@ class UserNotification extends BaseModel
public function users()
{
$related = 'App\User';
$related = \App\User::class;
$id = 'user_id';
return $this->belongsTo($related, $id);

View File

@@ -16,7 +16,7 @@ class Ticket_Thread extends Model
public function attach()
{
return $this->hasMany('App\Model\helpdesk\Ticket\Ticket_attachments', 'thread_id');
return $this->hasMany(\App\Model\helpdesk\Ticket\Ticket_attachments::class, 'thread_id');
}
public function delete()
@@ -149,7 +149,7 @@ class Ticket_Thread extends Model
public function user()
{
$related = 'App\User';
$related = \App\User::class;
$foreignKey = 'user_id';
return $this->belongsTo($related, $foreignKey);

View File

@@ -16,7 +16,7 @@ class Ticket_ThreadOld extends Model
public function attach()
{
return $this->hasMany('App\Model\helpdesk\Ticket\Ticket_attachments', 'thread_id');
return $this->hasMany(\App\Model\helpdesk\Ticket\Ticket_attachments::class, 'thread_id');
}
public function delete()

View File

@@ -16,17 +16,17 @@ class Tickets extends BaseModel
// }
public function thread()
{
return $this->hasMany('App\Model\helpdesk\Ticket\Ticket_Thread', 'ticket_id');
return $this->hasMany(\App\Model\helpdesk\Ticket\Ticket_Thread::class, 'ticket_id');
}
public function collaborator()
{
return $this->hasMany('App\Model\helpdesk\Ticket\Ticket_Collaborator', 'ticket_id');
return $this->hasMany(\App\Model\helpdesk\Ticket\Ticket_Collaborator::class, 'ticket_id');
}
public function helptopic()
{
$related = 'App\Model\helpdesk\Manage\Help_topic';
$related = \App\Model\helpdesk\Manage\Help_topic::class;
$foreignKey = 'help_topic_id';
return $this->belongsTo($related, $foreignKey);
@@ -34,7 +34,7 @@ class Tickets extends BaseModel
public function formdata()
{
return $this->hasMany('App\Model\helpdesk\Ticket\Ticket_Form_Data', 'ticket_id');
return $this->hasMany(\App\Model\helpdesk\Ticket\Ticket_Form_Data::class, 'ticket_id');
}
public function extraFields()
@@ -96,7 +96,7 @@ class Tickets extends BaseModel
public function user()
{
$related = "App\User";
$related = \App\User::class;
$foreignKey = 'user_id';
return $this->belongsTo($related, $foreignKey);