Commit a788f505 by Alexander Kochetov

Model::formName() correct PHP 5.3 code

parent 78a2914e
...@@ -186,9 +186,8 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess, Jsona ...@@ -186,9 +186,8 @@ class Model extends Component implements \IteratorAggregate, \ArrayAccess, Jsona
*/ */
public function formName() public function formName()
{ {
$class = get_class($this); $reflector = new \ReflectionClass($this);
$pos = strrpos($class, '\\'); return $reflector->getShortName();
return $pos === false ? $class : substr($class, $pos + 1);
} }
/** /**
......
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