本文整理汇总了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);
}
}