Commit 826c83c3 by Alexander Kochetov

ActiveRecord::getNamespacedClass() correct PHP 5.3 code

parent a788f505
...@@ -1393,13 +1393,12 @@ class ActiveRecord extends Model ...@@ -1393,13 +1393,12 @@ 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;
} }
}
/** /**
* @param array $link * @param array $link
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment