original_string: protected function setPriceRules(array $order)
      {
          foreach (array_keys($order['data']['components']) as $component_id) {
              if (is_numeric($component_id)) {
                  $rule = $this->price_rule->get($component_id);
                  if (isset($rule['code']) && $rule['code'] !== '') {
                      $this->price_rule->setUsed($rule['price_rule_id']);
                  }
              }
          }
      }
code: protected function setPriceRules(array $order)
      {
          foreach (array_keys($order['data']['components']) as $component_id) {
              if (is_numeric($component_id)) {
                  $rule = $this->price_rule->get($component_id);
                  if (isset($rule['code']) && $rule['code'] !== '') {
                      $this->price_rule->setUsed($rule['price_rule_id']);
                  }
              }
          }
      }
code_tokens: protected function setPriceRules ( array $ order ) { foreach ( array_keys ( $ order [ 'data' ] [ 'components' ] ) as $ component_id ) { if ( is_numeric ( $ component_id ) ) { $ rule = $ this -> price_rule -> get ( $ component_id ) ; if ( isset ( $ rule [ 'code' ] ) && $ rule [ 'code' ] !== '' ) { $ this -> price_rule -> setUsed ( $ rule [ 'price_rule_id' ] ) ; } } } }
docstring: Sets price rules after the order was created
  @param array $order
docstring_tokens: Sets price rules after the order was created