You are here

function commerce_condition_entity_exists_property_options_list in Commerce Core 7

Returns the options list for choosing a property of an entity type.

1 string reference to 'commerce_condition_entity_exists_property_options_list'
commerce_condition_entity_exists_info_alter in ./commerce.rules.inc
Info alteration callback for the entity query action.

File

./commerce.rules.inc, line 96
Rules integration for Drupal Commerce.

Code

function commerce_condition_entity_exists_property_options_list(RulesAbstractPlugin $element) {
  $element->settings += array(
    'type' => NULL,
  );
  if ($element->settings['type']) {
    $properties = entity_get_all_property_info($element->settings['type']);
    return rules_extract_property($properties, 'label');
  }
}