本文整理匯總了PHP中mymodule_add_something函數的典型用法代碼示例。如果您正苦於以下問題:PHP mymodule_add_something函數的具體用法?PHP mymodule_add_something怎麽用?PHP mymodule_add_something使用的例子?那麽, 這裏精選的函數代碼示例或許可以為您提供幫助。
在下文中一共展示了mymodule_add_something函數的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: hook_ENTITY_TYPE_load
/**
* Act on entities of a specific type when loaded.
*
* @param array $entities
* The entities keyed by entity ID.
*
* @ingroup entity_crud
* @see hook_entity_load()
*/
function hook_ENTITY_TYPE_load($entities)
{
foreach ($entities as $entity) {
$entity->foo = mymodule_add_something($entity);
}
}
示例2: hook_entity_load
/**
* Act on entities when loaded.
*
* This is a generic load hook called for all entity types loaded via the
* entity API.
*
* @param $entities
* The entities keyed by entity ID.
* @param $type
* The type of entities being loaded (i.e. node, user, comment).
*/
function hook_entity_load($entities, $type)
{
foreach ($entities as $entity) {
$entity->foo = mymodule_add_something($entity, $type);
}
}