You are here

function ca_data_map in Ubercart 7.3

Maps obsolete conditions to correct settings for 'data_is'.

1 call to ca_data_map()
ca_add_conditions in uc_store/includes/ca.inc
Reads a predicate's conditions array and add them to a component.

File

uc_store/includes/ca.inc, line 314
Helper functions for upgrade from Ubercart 2.x to Ubercart 3.x.

Code

function ca_data_map() {
  return array(
    'ca_condition_date' => array(
      'data' => 'system:date',
      // @todo: use the correct selector
      'op' => 'operator',
      'value' => 'date',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'date',
          ),
        ),
      ),
    ),
    'ca_condition_user_roles' => array(
      'data' => 'user:roles',
      'value' => 'roles',
      'op' => 'operator',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'list<integer>',
            'options list' => 'entity_metadata_user_roles',
          ),
        ),
      ),
    ),
    'node_field_comparison' => array(
      'data' => '*',
      'op' => 'operator',
      'value' => 'value',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => '*',
          ),
        ),
      ),
    ),
    'uc_cart_condition_product_class' => array(
      'data' => 'product:type',
      'value' => 'class',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'list<text>',
            'options list' => 'node_type_get_names',
          ),
        ),
      ),
    ),
    'uc_quote_condition_product_shipping_type' => array(
      'data' => 'product:shipping-type',
      'value' => 'type',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'text',
            'options list' => 'uc_quote_shipping_type_options',
          ),
        ),
      ),
    ),
    'uc_order_condition_payment_method' => array(
      'data' => 'order:payment-method',
      'value' => 'payment_method',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'text',
          ),
        ),
      ),
    ),
    'uc_order_status_condition' => array(
      'data' => 'order:order-status',
      'value' => 'order_status',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'text',
            'options list' => 'uc_order_status_list',
          ),
        ),
      ),
    ),
    'uc_order_condition_total' => array(
      'data' => 'order:order-total',
      'value' => 'order_total_value',
      'op' => 'order_total_comparison',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'decimal',
          ),
        ),
      ),
    ),
    'uc_order_condition_delivery_postal_code' => array(
      'data' => 'order:delivery-address:postal-code',
      'value' => 'pattern',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'text',
          ),
        ),
      ),
    ),
    'uc_order_condition_delivery_zone' => array(
      'data' => 'order:delivery-address:zone',
      'value' => 'zones',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'list<integer>',
            'options list' => 'uc_zone_option_list',
          ),
        ),
      ),
    ),
    'uc_order_condition_delivery_country' => array(
      'data' => 'order:delivery-address:country',
      'value' => 'countries',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'list<integer>',
            'options list' => 'uc_country_option_list',
          ),
        ),
      ),
    ),
    'uc_order_condition_billing_postal_code' => array(
      'data' => 'order:billing-address:postal-code',
      'value' => 'pattern',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'text',
          ),
        ),
      ),
    ),
    'uc_order_condition_billing_zone' => array(
      'data' => 'order:billing-address:zone',
      'value' => 'zones',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'list<integer>',
            'options list' => 'uc_zone_option_list',
          ),
        ),
      ),
    ),
    'uc_order_condition_billing_country' => array(
      'data' => 'order:billing-address:country',
      'value' => 'countries',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'list<integer>',
            'options list' => 'uc_country_option_list',
          ),
        ),
      ),
    ),
    'uc_order_condition_user_name' => array(
      'data' => 'user:name',
      'value' => 'name',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'text',
          ),
        ),
      ),
    ),
    'uc_order_condition_user_email' => array(
      'data' => 'user:mail',
      'value' => 'mail',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'text',
          ),
        ),
      ),
    ),
    'uc_order_condition_user_created' => array(
      'data' => 'user:created',
      'value' => 'created',
      'op' => 'operator',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'date',
          ),
        ),
      ),
    ),
    'uc_order_condition_user_login' => array(
      'data' => 'user:login',
      'value' => 'login',
      'op' => 'operator',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'date',
          ),
        ),
      ),
    ),
    'uc_order_condition_user_language' => array(
      'data' => 'user:language',
      'value' => 'language',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'text',
          ),
        ),
      ),
    ),
    'uc_order_condition_user_roles' => array(
      'data' => 'user:roles',
      'value' => 'roles',
      'op' => 'operator',
      '#info' => array(
        'parameter' => array(
          'value' => array(
            'type' => 'list<integer>',
            'options list' => 'entity_metadata_user_roles',
          ),
        ),
      ),
    ),
  );
}