0
我试图调用与反射实体的getter但它返回一些奇怪的物体:ReflectionMethod调用的学说实体返回代理
Proxies__CG __ \富\ InvoiceBundle \实体\发票
代替的
富\ InvoiceBundle \实体\发票
这里是我的代码:
class ProperProperty extends \ReflectionProperty{
public function __construct(){
parent::__construct();
}
private function getGetterName($propertyName){
$ret = "get" . ucfirst($propertyName);
return $ret;
}
public function getDoctrineValue($class, $object){
$propertyName = $this->getName();
$getterName = $this->getGetterName($propertyName);
$reflectionMethod = new \ReflectionMethod($class, $getterName);
$ret = $reflectionMethod->invoke($object);
return $ret;
}
}
我看到了代理类,其中还挺懒加载对象,反正是有强制此负载? 感谢:d