You are here

function hook_commerce_entity_create_alter in Commerce Core 7

Allows modules to alter newly created Commerce entities.

Commerce's default entity controller, DrupalCommerceEntityController, invokes this hook after creating a new entity object using either a class specified by the entity type info or a stdClass. Using this hook, you can alter the entity before it is returned to any of our entity "new" API functions such as commerce_product_new().

Parameters

$entity_type: The machine-name type of the entity.

$entity: The entity object that was just created.

1 invocation of hook_commerce_entity_create_alter()
DrupalCommerceEntityController::create in includes/commerce.controller.inc
Create a new entity.

File

./commerce.api.php, line 177
This file contains no working PHP code; it exists to provide additional documentation for doxygen as well as to document hooks in the standard Drupal manner.

Code

function hook_commerce_entity_create_alter($entity_type, $entity) {

  // No example.
}