 9a6f1788a4
			
		
	
	9a6f1788a4
	
	
	
		
			
			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.
		
			
				
	
	
		
			37 lines
		
	
	
		
			716 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
			
		
		
	
	
			37 lines
		
	
	
		
			716 B
		
	
	
	
		
			PHP
		
	
	
	
	
	
| <?php
 | |
| 
 | |
| namespace App\Model\helpdesk\Notification;
 | |
| 
 | |
| use App\BaseModel;
 | |
| 
 | |
| class UserNotification extends BaseModel
 | |
| {
 | |
|     protected $table = 'user_notification';
 | |
| 
 | |
|     protected $fillable = [
 | |
| 
 | |
|         'notification_id', 'user_id', 'is_read',
 | |
|     ];
 | |
| 
 | |
|     public function notification()
 | |
|     {
 | |
|         $related = \App\Model\helpdesk\Notification\Notification::class;
 | |
|         $id = 'notification_id';
 | |
| 
 | |
|         return $this->belongsTo($related, $id);
 | |
|     }
 | |
| 
 | |
|     public function users()
 | |
|     {
 | |
|         $related = \App\User::class;
 | |
|         $id = 'user_id';
 | |
| 
 | |
|         return $this->belongsTo($related, $id);
 | |
|     }
 | |
| 
 | |
| //    public function delete() {
 | |
| //        //$this->notification()->delete();
 | |
| //        parent::delete();
 | |
| //    }
 | |
| }
 |