This commit is contained in:
Qiang Xue
2012-05-18 12:32:11 -04:00
parent b3e6169a3c
commit b3460fc30e
3 changed files with 3 additions and 3 deletions

View File

@ -300,7 +300,7 @@ class ActiveFinder extends \yii\base\Object
}
if ($config instanceof \Closure) {
call_user_func($config, $child->query);
$config($child->query);
} else {
foreach ($config as $name => $value) {
$child->query->$name = $value;

View File

@ -574,7 +574,7 @@ abstract class ActiveRecord extends Model
}
$relation = clone $relation;
if ($params instanceof \Closure) {
call_user_func($params, $relation);
$params($relation);
} else {
foreach ($params as $name => $value) {
$relation->$name = $value;

View File

@ -77,7 +77,7 @@ class ArrayHelper
public static function get($array, $key, $default = null)
{
if ($key instanceof \Closure) {
return call_user_func($key, $array, $default);
return $key($array, $default);
} elseif (is_array($array)) {
return isset($array[$key]) || array_key_exists($key, $array) ? $array[$key] : $default;
} else {