original_string: public function getTriggered(array $data, array $options)
      {
          $options['trigger_id'] = $this->trigger->getTriggered($data, $options);
  
          if (empty($options['trigger_id'])) {
              return array();
          }
  
          $coupons = 0;
          $results = array();
  
          foreach ((array) $this->getList($options) as $id => $rule) {
  
              if ($rule['code'] !== '') {
                  $coupons++;
              }
  
              if ($coupons <= 1) {
                  $results[$id] = $rule;
              }
          }
  
          // Coupons always go last
          uasort($results, function ($a) {
              return $a['code'] === '' ? -1 : 1;
          });
  
          return $results;
      }
code: public function getTriggered(array $data, array $options)
      {
          $options['trigger_id'] = $this->trigger->getTriggered($data, $options);
  
          if (empty($options['trigger_id'])) {
              return array();
          }
  
          $coupons = 0;
          $results = array();
  
          foreach ((array) $this->getList($options) as $id => $rule) {
  
              if ($rule['code'] !== '') {
                  $coupons++;
              }
  
              if ($coupons <= 1) {
                  $results[$id] = $rule;
              }
          }
  
          // Coupons always go last
          uasort($results, function ($a) {
              return $a['code'] === '' ? -1 : 1;
          });
  
          return $results;
      }
code_tokens: public function getTriggered ( array $ data , array $ options ) { $ options [ 'trigger_id' ] = $ this -> trigger -> getTriggered ( $ data , $ options ) ; if ( empty ( $ options [ 'trigger_id' ] ) ) { return array ( ) ; } $ coupons = 0 ; $ results = array ( ) ; foreach ( ( array ) $ this -> getList ( $ options ) as $ id => $ rule ) { if ( $ rule [ 'code' ] !== '' ) { $ coupons ++ ; } if ( $ coupons <= 1 ) { $ results [ $ id ] = $ rule ; } } // Coupons always go last uasort ( $ results , function ( $ a ) { return $ a [ 'code' ] === '' ? - 1 : 1 ; } ) ; return $ results ; }
docstring: Returns an array of triggered price rules
  @param array $data
  @param array $options
  @return array
docstring_tokens: Returns an array of triggered price rules