mirror of
https://github.com/yiisoft/yii2.git
synced 2025-08-26 06:15:19 +08:00
Fixes #3016.
This commit is contained in:
@ -655,6 +655,9 @@ class DbManager extends Manager
|
||||
*/
|
||||
public function getRule($name)
|
||||
{
|
||||
if ($name === null) {
|
||||
return null;
|
||||
}
|
||||
$query = new Query;
|
||||
$query->select(['data'])->from($this->ruleTable)->where(['name' => $name]);
|
||||
$row = $query->createCommand($this->db)->queryOne();
|
||||
|
@ -628,11 +628,7 @@ class PhpManager extends Manager
|
||||
*/
|
||||
public function getRule($name)
|
||||
{
|
||||
if (!isset($this->_rules[$name])) {
|
||||
return null;
|
||||
}
|
||||
|
||||
return $this->_rules[$name];
|
||||
return $name !== null && isset($this->_rules[$name]) ? $this->_rules[$name] : null;
|
||||
}
|
||||
|
||||
/**
|
||||
|
Reference in New Issue
Block a user