You are here

function pathauto_i18n_process_entity_object in Pathauto i18n 8

Same name and namespace in other branches
  1. 7 pathauto_i18n.module \pathauto_i18n_process_entity_object()

Insert entity to pathauto_i18n table and generate alias if necessary.

7 calls to pathauto_i18n_process_entity_object()
pathauto_i18n_node_node_insert in modules/pathauto_i18n_node/pathauto_i18n_node.module
Implements hook_node_insert().
pathauto_i18n_node_node_update in modules/pathauto_i18n_node/pathauto_i18n_node.module
Implements hook_node_update().
pathauto_i18n_taxonomy_taxonomy_term_insert in modules/pathauto_i18n_taxonomy/pathauto_i18n_taxonomy.module
Implements hook_taxonomy_term_insert().
pathauto_i18n_taxonomy_taxonomy_term_update in modules/pathauto_i18n_taxonomy/pathauto_i18n_taxonomy.module
Implements hook_taxonomy_term_update().
pathauto_i18n_user_pathauto_alias_alter in modules/pathauto_i18n_user/pathauto_i18n_user.module
Implements hook_pathauto_alias_alter().

... See full list

File

./pathauto_i18n.module, line 20
Provides common functions and callbacks for pathauto_i18n submodules.

Code

function pathauto_i18n_process_entity_object($entity, $entity_type, $pathauto_i18n_status, $op) {

  // Get entity properties.
  list($entity_id, , $bundle) = entity_extract_ids($entity_type, $entity);

  // Insert pathauto_i18n settings.
  if (!empty($entity_id) && !empty($bundle) && !empty($entity_type)) {
    pathauto_i18n_insert_settings($entity_id, $entity_type, $bundle, $pathauto_i18n_status);

    // Build aliases in it necessary.
    if ($pathauto_i18n_status) {
      pathauto_i18n_update_alias($entity, $entity_type, $bundle, $op);
    }
  }
}