Skip to content

Commit

Permalink
dev
Browse files Browse the repository at this point in the history
  • Loading branch information
skeeks-semenov committed May 16, 2018
1 parent 4bf144a commit 2e4a737
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 2 deletions.
5 changes: 4 additions & 1 deletion src/actions/backend/BackendModelMultiActivateAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,9 @@
*/
class BackendModelMultiActivateAction extends BackendModelMultiAction {

public $attribute = 'active';
public $value = Cms::BOOL_Y;

public function init()
{
if (!$this->icon)
Expand All @@ -36,7 +39,7 @@ public function init()
public function eachExecute($model)
{
try {
$model->active = Cms::BOOL_Y;
$model->{$this->attribute} = $this->value;
return $model->save(false);
} catch (\Exception $e) {
return false;
Expand Down
5 changes: 4 additions & 1 deletion src/actions/backend/BackendModelMultiDeactivateAction.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,9 @@
* @author Semenov Alexander <semenov@skeeks.com>
*/
class BackendModelMultiDeactivateAction extends BackendModelMultiAction {
public $attribute = 'active';
public $value = Cms::BOOL_N;

public function init()
{
if (!$this->icon)
Expand All @@ -35,7 +38,7 @@ public function init()
public function eachExecute($model)
{
try {
$model->active = Cms::BOOL_N;
$model->{$this->attribute} = $this->value;
return $model->save(false);
} catch (\Exception $e) {
return false;
Expand Down

0 comments on commit 2e4a737

Please sign in to comment.