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:
@@ -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);
|
||||
|
||||
@@ -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()
|
||||
|
||||
@@ -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);
|
||||
|
||||
Reference in New Issue
Block a user