本文整理汇总了PHP中EEM_Base::verify_is_valid_cap_context方法的典型用法代码示例。如果您正苦于以下问题:PHP EEM_Base::verify_is_valid_cap_context方法的具体用法?PHP EEM_Base::verify_is_valid_cap_context怎么用?PHP EEM_Base::verify_is_valid_cap_context使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类EEM_Base
的用法示例。
在下文中一共展示了EEM_Base::verify_is_valid_cap_context方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: cap_restrictions
/**
* Returns the capability-restrictions array (@see EEM_Base::_cap_restrictions).
*
* If $context is provided (which should be set to one of EEM_Base::valid_cap_contexts())
* only returns the cap restrictions array in that context (ie, the array
* at that key)
* @param string $context
* @return EE_Default_Where_Conditions[] indexed by associated capability
*/
public function cap_restrictions($context = EEM_Base::caps_read)
{
EEM_Base::verify_is_valid_cap_context($context);
//check if we ought to run the restriction generator first
if (isset($this->_cap_restriction_generators[$context]) && $this->_cap_restriction_generators[$context] instanceof EE_Restriction_Generator_Base && !$this->_cap_restriction_generators[$context]->has_generated_cap_restrictions()) {
$this->_cap_restrictions[$context] = array_merge($this->_cap_restrictions[$context], $this->_cap_restriction_generators[$context]->generate_restrictions());
}
//and make sure we've finalized the construction of each restriction
foreach ($this->_cap_restrictions[$context] as $where_conditions_obj) {
$where_conditions_obj->_finalize_construct($this);
}
return $this->_cap_restrictions[$context];
}