Apply fixes from StyleCI

This commit is contained in:
Manish Verma
2016-12-13 13:14:54 +00:00
committed by StyleCI Bot
parent 857d3004eb
commit 88f3df2180
161 changed files with 4729 additions and 3879 deletions

View File

@@ -11,44 +11,53 @@ class Notification extends BaseModel
'model_id', 'userid_created', 'type_id',
];
public function type(){
public function type()
{
$related = 'App\Model\helpdesk\Notification\NotificationType';
$id = 'type_id';
return $this->belongsTo($related,$id);
return $this->belongsTo($related, $id);
}
public function model(){
public function model()
{
$related = 'App\Model\helpdesk\Ticket\Tickets';
$id = 'model_id';
return $this->belongsTo($related,$id);
return $this->belongsTo($related, $id);
}
public function userNotification(){
public function userNotification()
{
$related = 'App\Model\helpdesk\Notification\UserNotification';
$foreignKey = 'notification_id';
return $this->hasMany($related, $foreignKey);
}
public function deleteUserNotification(){
public function deleteUserNotification()
{
$user_notifications = $this->userNotification;
if(count($user_notifications)>0){
foreach($user_notifications as $noti){
if (count($user_notifications) > 0) {
foreach ($user_notifications as $noti) {
$noti->delete();
}
}
}
public function dummyDelete(){
$user_notifications = UserNotification::get();
if(count($user_notifications)>0){
foreach($user_notifications as $noti){
public function dummyDelete()
{
$user_notifications = UserNotification::get();
if (count($user_notifications) > 0) {
foreach ($user_notifications as $noti) {
$noti->delete();
}
}
}
public function delete() {
public function delete()
{
$this->deleteUserNotification();
// $this->dummyDelete();
parent::delete();