You are here

function commerce_order_has_owner_build in Commerce Discount 7

Build callback for commerce_order_has_owner.

Parameters

EntityDrupalWrapper $wrapper: The wrapped entity given by the rule.

array $account: A fully loaded drupal user.

Return value

bool Returns true if condition is valid. false otherwise.

1 string reference to 'commerce_order_has_owner_build'
commerce_discount_inline_conditions_info in ./commerce_discount.inline_conditions.inc
Implements hook_inline_conditions_info().

File

./commerce_discount.rules.inc, line 641
Rules integration for the Commerce Discount module.

Code

function commerce_order_has_owner_build(EntityDrupalWrapper $wrapper, $account) {
  if (isset($account->uid)) {

    // If current logged user matches the discount related users.
    return $account->uid == $wrapper->uid
      ->value();
  }
  return FALSE;
}