original_string: protected function actionListPriceRule()
      {
          list($selected, $action, $value) = $this->getPostedAction();
  
          $deleted = $updated = 0;
  
          foreach ($selected as $rule_id) {
  
              if ($action === 'status' && $this->access('price_rule_edit')) {
                  $updated += (int) $this->price_rule->update($rule_id, array('status' => $value));
              }
  
              if ($action === 'delete' && $this->access('price_rule_delete')) {
                  $deleted += (int) $this->price_rule->delete($rule_id);
              }
          }
  
          if ($updated > 0) {
              $message = $this->text('Updated %num item(s)', array('%num' => $updated));
              $this->setMessage($message, 'success');
          }
  
          if ($deleted > 0) {
              $message = $this->text('Deleted %num item(s)', array('%num' => $deleted));
              $this->setMessage($message, 'success');
          }
      }
code: protected function actionListPriceRule()
      {
          list($selected, $action, $value) = $this->getPostedAction();
  
          $deleted = $updated = 0;
  
          foreach ($selected as $rule_id) {
  
              if ($action === 'status' && $this->access('price_rule_edit')) {
                  $updated += (int) $this->price_rule->update($rule_id, array('status' => $value));
              }
  
              if ($action === 'delete' && $this->access('price_rule_delete')) {
                  $deleted += (int) $this->price_rule->delete($rule_id);
              }
          }
  
          if ($updated > 0) {
              $message = $this->text('Updated %num item(s)', array('%num' => $updated));
              $this->setMessage($message, 'success');
          }
  
          if ($deleted > 0) {
              $message = $this->text('Deleted %num item(s)', array('%num' => $deleted));
              $this->setMessage($message, 'success');
          }
      }
code_tokens: protected function actionListPriceRule ( ) { list ( $ selected , $ action , $ value ) = $ this -> getPostedAction ( ) ; $ deleted = $ updated = 0 ; foreach ( $ selected as $ rule_id ) { if ( $ action === 'status' && $ this -> access ( 'price_rule_edit' ) ) { $ updated += ( int ) $ this -> price_rule -> update ( $ rule_id , array ( 'status' => $ value ) ) ; } if ( $ action === 'delete' && $ this -> access ( 'price_rule_delete' ) ) { $ deleted += ( int ) $ this -> price_rule -> delete ( $ rule_id ) ; } } if ( $ updated > 0 ) { $ message = $ this -> text ( 'Updated %num item(s)' , array ( '%num' => $ updated ) ) ; $ this -> setMessage ( $ message , 'success' ) ; } if ( $ deleted > 0 ) { $ message = $ this -> text ( 'Deleted %num item(s)' , array ( '%num' => $ deleted ) ) ; $ this -> setMessage ( $ message , 'success' ) ; } }
docstring: Applies an action to the selected price rules
docstring_tokens: Applies an action to the selected price rules