Fix indentation issues

This commit is contained in:
Tautvidas Sipavičius
2016-06-30 13:29:23 +03:00
parent 8a9d14319b
commit b7d8d482fe
14 changed files with 97 additions and 76 deletions

View File

@@ -55,7 +55,7 @@ class Model extends \Sudzy\ValidModel {
} else {
$this->setError($e->getMessage());
}
break;
break;
default:
$this->setError($e->getMessage());
}
@@ -94,7 +94,7 @@ class Model extends \Sudzy\ValidModel {
static function bulkRestore($orm) {
$model = get_called_class();
return self::bulkAction($orm, function($ids) use($model) {
self::rawExecute(join(' ', array(
self::rawExecute(join(' ', array(
'UPDATE `'.$model::$_table.'`',
'SET `deleted_at` = NULL',
'WHERE `id` IN ('.rtrim(str_repeat('?,', count($ids)), ',').')'

View File

@@ -287,12 +287,20 @@ class Newsletter extends Model {
$orm = $orm
->left_outer_join(
MP_NEWSLETTER_OPTION_TABLE,
array(MP_NEWSLETTERS_TABLE.'.id', '=',
MP_NEWSLETTER_OPTION_TABLE.'.newsletter_id'))
array(
MP_NEWSLETTERS_TABLE.'.id',
'=',
MP_NEWSLETTER_OPTION_TABLE.'.newsletter_id'
)
)
->left_outer_join(
MP_NEWSLETTER_OPTION_FIELDS_TABLE,
array(MP_NEWSLETTER_OPTION_FIELDS_TABLE.'.id','=',
MP_NEWSLETTER_OPTION_TABLE.'.option_field_id'))
array(
MP_NEWSLETTER_OPTION_FIELDS_TABLE.'.id',
'=',
MP_NEWSLETTER_OPTION_TABLE.'.option_field_id'
)
)
->group_by(MP_NEWSLETTERS_TABLE.'.id');
return $orm;
}
@@ -346,7 +354,7 @@ class Newsletter extends Model {
->count()
)
));
break;
break;
case self::TYPE_WELCOME:
case self::TYPE_NOTIFICATION:
@@ -368,7 +376,7 @@ class Newsletter extends Model {
->count()
)
));
break;
break;
}
$groups[] = array(
@@ -394,11 +402,11 @@ class Newsletter extends Model {
$orm
->whereNull('deleted_at')
->filter('filterStatus', $group);
break;
break;
case 'trash':
$orm->whereNotNull('deleted_at');
break;
break;
default:
$orm->whereNull('deleted_at');

View File

@@ -322,12 +322,20 @@ class Subscriber extends Model {
$orm = $orm
->leftOuterJoin(
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE,
array(MP_SUBSCRIBERS_TABLE.'.id', '=',
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.subscriber_id'))
array(
MP_SUBSCRIBERS_TABLE.'.id',
'=',
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.subscriber_id'
)
)
->leftOuterJoin(
MP_CUSTOM_FIELDS_TABLE,
array(MP_CUSTOM_FIELDS_TABLE.'.id','=',
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.custom_field_id'))
array(
MP_CUSTOM_FIELDS_TABLE.'.id',
'=',
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.custom_field_id'
)
)
->groupBy(MP_SUBSCRIBERS_TABLE.'.id');
return $orm;
}
@@ -345,12 +353,18 @@ class Subscriber extends Model {
$orm = $orm
->leftOuterJoin(
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE,
array(MP_SUBSCRIBERS_TABLE.'.id', '=',
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.subscriber_id'))
array(
MP_SUBSCRIBERS_TABLE.'.id', '=',
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.subscriber_id'
)
)
->leftOuterJoin(
MP_CUSTOM_FIELDS_TABLE,
array(MP_CUSTOM_FIELDS_TABLE.'.id','=',
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.custom_field_id'));
array(
MP_CUSTOM_FIELDS_TABLE.'.id','=',
MP_SUBSCRIBER_CUSTOM_FIELD_TABLE.'.custom_field_id'
)
);
return $orm;
}
@@ -532,7 +546,8 @@ class Subscriber extends Model {
SubscriberSegment::subscribeManyToSegments(
$subscriber_ids, array($segment->id)
);
});
}
);
return array(
'subscribers' => $subscribers_count,
@@ -653,8 +668,9 @@ class Subscriber extends Model {
str_repeat(
'(' . rtrim(str_repeat('?,', count($columns)), ',') . ')' . ', '
, count($values)
)
, ', '),
),
', '
),
Helpers::flattenArray($values)
);
}