Browse Source

ActiveRecord::getNamespacedClass() correct PHP 5.3 code

tags/2.0.0-beta
Alexander Kochetov 12 years ago
parent
commit
826c83c301
  1. 9
      framework/yii/db/ActiveRecord.php

9
framework/yii/db/ActiveRecord.php

@ -1393,13 +1393,12 @@ class ActiveRecord extends Model
protected function getNamespacedClass($class)
{
if (strpos($class, '\\') === false) {
$primaryClass = get_class($this);
if (($pos = strrpos($primaryClass, '\\')) !== false) {
return substr($primaryClass, 0, $pos + 1) . $class;
}
}
$reflector = new \ReflectionClass($this);
return $reflector->getNamespaceName() . '\\' . $class;
} else {
return $class;
}
}
/**
* @param array $link

Loading…
Cancel
Save