Skip to content

Instantly share code, notes, and snippets.

@alexlcdee
Created October 20, 2017 11:19
Show Gist options
  • Save alexlcdee/8c96d379892e82c23380c3eda273fd41 to your computer and use it in GitHub Desktop.
Save alexlcdee/8c96d379892e82c23380c3eda273fd41 to your computer and use it in GitHub Desktop.
<?php
return [
'updateModel' => [
// authItem definition
'bizRule' => function($params, $data) {
return my_biz_rule_code();
}
]
];
<?php
class PhpAuthManager extends CPhpAuthManager
{
// your code
public function executeBizRule($bizRule, $params, $data)
{
$bizRule = $bizRule ? @unserialize($bizRule) : null;
if (is_callable($bizRule)) {
return call_user_func_array($bizRule, [$params, $data]);
}
return parent::executeBizRule($bizRule, $params, $data);
}
// your other code
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment