/** * * @param string $type * @param StdObject $stdObject * @return ssrs Object */ protected function FromStdObject_Base($type, $stdObject) { $object; if ($type != 'self') { $class = new ReflectionClass($type); $object = $class->newInstance(); } else { $type = get_class($this); $class = new ReflectionClass($type); $object = $this; } $properties = $class->getProperties(); foreach ($properties as $rawProperty) { $propertyName = $rawProperty->name; $property = new ReflectionProperty($object, $propertyName); $attributes = Utility::getAttributes($property); $value = null; switch (SSRSTypeFactory::GetType($attributes['type'])) { case 'basic': $value = self::EnumerateBasicObject($stdObject, $propertyName, $attributes); break; case 'ssrs': $value = self::EnumerateSSRSObject($stdObject, $propertyName, $attributes); break; case 'unknown': throw new PReportException("", "Exception: Unknown_Type:" . $attributes['type']); break; } $property->setValue($object, $value); } $object->Initialize(); return $object; }