private function forgeInstance($instance)
    {
        $reflection = new ReflectionClass($instance);
        foreach ($reflection->getProperties() as $key => $property) {
            if (!$property instanceof ReflectionProperty) {
                continue;
            }
            $entity = $this->getEntityFromModel($key, $property->getName());
            $value = $property->getValue($instance);

            if (is_array($value)) {
                $this->processPropertyValues($instance, $property, $entity, $value);
            } else {
                $this->processPropertyValue($instance, $property, $entity, $value);
            }
        }
        return $instance;
    }
private function forgeInstance($instance)
    {
        $reflection = new ReflectionClass($instance);
        foreach ($reflection->getProperties() as $key => $property) {
            if (!$property instanceof ReflectionProperty) {
                continue;
            }
            $entity = $this->getEntityFromModel($key, $property->getName());
            $value = $property->getValue($instance);

            if (is_array($value)) {
                $this->processPropertyValues($instance, $property, $entity, $value);
            } else {
                $this->processPropertyValue($instance, $property, $entity, $value);
            }
        }
        return $instance;
    }
private function forgeInstance ( $ instance ) { $ reflection = new ReflectionClass ( $ instance ) ; foreach ( $ reflection -> getProperties ( ) as $ key => $ property ) { if ( ! $ property instanceof ReflectionProperty ) { continue ; } $ entity = $ this -> getEntityFromModel ( $ key , $ property -> getName ( ) ) ; $ value = $ property -> getValue ( $ instance ) ; if ( is_array ( $ value ) ) { $ this -> processPropertyValues ( $ instance , $ property , $ entity , $ value ) ; } else { $ this -> processPropertyValue ( $ instance , $ property , $ entity , $ value ) ; } } return $ instance ; }
Creates new instance of target class with specified values
It also adjusts any nested type based on suplied metadata (@var annotation)
@return mixed returns domain model instance
Creates new instance of target class with specified values It also adjusts any nested type based on suplied metadata (