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

Loading…
Cancel
Save