本文整理汇总了PHP中Pimcore\Resource::stopCapturingDefinitionModifications方法的典型用法代码示例。如果您正苦于以下问题:PHP Resource::stopCapturingDefinitionModifications方法的具体用法?PHP Resource::stopCapturingDefinitionModifications怎么用?PHP Resource::stopCapturingDefinitionModifications使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimcore\Resource
的用法示例。
在下文中一共展示了Resource::stopCapturingDefinitionModifications方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: callResourceMethod
/**
* @param string $method
* @param array $args
* @return mixed
*/
public function callResourceMethod($method, $args)
{
$resource = $this->getResource();
if ($this->inTransaction || Resource::isWriteQuery($method, $args)) {
$resource = $this->getWriteResource();
}
$capture = false;
if (\Pimcore::inAdmin()) {
$methodsToCheck = array("query", "update", "delete", "insert");
if (in_array($method, $methodsToCheck)) {
$capture = true;
Resource::startCapturingDefinitionModifications($resource, $method, $args);
}
}
$r = call_user_func_array(array($resource, $method), $args);
if (\Pimcore::inAdmin() && $capture) {
Resource::stopCapturingDefinitionModifications($resource);
}
return $r;
}
示例2: callResourceMethod
/**
* @param string $method
* @param array $args
* @return mixed
*/
public function callResourceMethod($method, $args)
{
$resource = $this->getResource();
/*if($method == "query" && Pimcore_Resource::isDDLQuery($args[0])) {
$resource = $this->getDDLResource();
}*/
$capture = false;
if (\Pimcore::inAdmin()) {
$methodsToCheck = array("query", "update", "delete", "insert");
if (in_array($method, $methodsToCheck)) {
$capture = true;
Resource::startCapturingDefinitionModifications($resource, $method, $args);
}
}
$r = call_user_func_array(array($resource, $method), $args);
if (\Pimcore::inAdmin() && $capture) {
Resource::stopCapturingDefinitionModifications($resource);
}
return $r;
}