本文整理汇总了PHP中ElggGroup::getAnnotations方法的典型用法代码示例。如果您正苦于以下问题:PHP ElggGroup::getAnnotations方法的具体用法?PHP ElggGroup::getAnnotations怎么用?PHP ElggGroup::getAnnotations使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ElggGroup
的用法示例。
在下文中一共展示了ElggGroup::getAnnotations方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: test_disabling_annotations_infinite_loop
/**
* Ensure that \ElggBatch doesn't go into infinite loop when disabling annotations recursively when show hidden is enabled.
*
* https://github.com/Elgg/Elgg/issues/5952
*/
public function test_disabling_annotations_infinite_loop()
{
//let's have some entity
$group = new \ElggGroup();
$group->name = 'test_group';
$group->access_id = ACCESS_PUBLIC;
$this->assertTrue($group->save() !== false);
$total = 51;
//add some annotations
for ($cnt = 0; $cnt < $total; $cnt++) {
$group->annotate('test_annotation', 'value_' . $total);
}
//disable them
$show_hidden = access_get_show_hidden_status();
access_show_hidden_entities(true);
$options = array('guid' => $group->guid, 'limit' => $total);
elgg_disable_annotations($options);
access_show_hidden_entities($show_hidden);
//confirm all being disabled
$annotations = $group->getAnnotations(array('limit' => $total));
foreach ($annotations as $annotation) {
$this->assertTrue($annotation->enabled == 'no');
}
//delete group and annotations
$group->delete();
}