function field_collection_pathauto_create_alias in Field collection 7
Create a path alias for a field collection item.
Parameters
object $host_entity: Entity to which the field collection item belongs.
object $entity: Field collection item.
string $op: Operation to perform for pathauto_create_alias(). Can be 'insert', 'update', 'return', or 'bulkupdate'.
See also
field_collection_field_update()
2 calls to field_collection_pathauto_create_alias()
- field_collection_field_insert in ./
field_collection.module - Implements hook_field_insert().
- field_collection_field_update in ./
field_collection.module - Implements hook_field_update().
File
- ./
field_collection.pathauto.inc, line 55
Code
function field_collection_pathauto_create_alias($host_entity, $entity, $op, $options = array()) {
module_load_include('inc', 'pathauto');
pathauto_create_alias('field_collection', $op, 'field-collection/' . str_replace('_', '-', $entity->field_name) . '/' . $entity->item_id, array(
'field_collection_item' => $entity,
), $entity->field_name);
}