You are here

public function EntityReference_SelectionHandler_Generic_commerce_coupon::getLabel in Commerce Coupon 7

Implements EntityReferenceHandler::getLabel().

Overrides EntityReference_SelectionHandler_Generic::getLabel

File

plugins/selection/EntityReference_SelectionHandler_Generic_commerce_coupon.class.php, line 17

Class

EntityReference_SelectionHandler_Generic_commerce_coupon
Extend the entity reference selection class to use the coupon code for building the EFQ.

Code

public function getLabel($entity) {
  $wrapper = entity_metadata_wrapper('commerce_coupon', $entity);
  return $wrapper->commerce_coupon_code
    ->value();
}