public function createView($object)
    {
        if (is_array($object)) {
            return array_map([ $this, 'createView' ], $object);
        }

        $view = $this->factory->createView($object);

        if (false === $view instanceof View) {
            return $this->notSuitableFactoryFor($object);
        }

        if ($view instanceof RootViewFactoryAware) {
            $view->setRootViewFactory($this);
        }

        return $view;
    }
public function createView($object)
    {
        if (is_array($object)) {
            return array_map([ $this, 'createView' ], $object);
        }

        $view = $this->factory->createView($object);

        if (false === $view instanceof View) {
            return $this->notSuitableFactoryFor($object);
        }

        if ($view instanceof RootViewFactoryAware) {
            $view->setRootViewFactory($this);
        }

        return $view;
    }
public function createView ( $ object ) { if ( is_array ( $ object ) ) { return array_map ( [ $ this , 'createView' ] , $ object ) ; } $ view = $ this -> factory -> createView ( $ object ) ; if ( false === $ view instanceof View ) { return $ this -> notSuitableFactoryFor ( $ object ) ; } if ( $ view instanceof RootViewFactoryAware ) { $ view -> setRootViewFactory ( $ this ) ; } return $ view ; }
Create a view for the object, allows arrays recursively

@param $object

@return View

@throws Exception\UnsupportedObjectException
Create a view for the object allows arrays recursively