TYPO3  7.6
Public Member Functions | Public Attributes | Protected Member Functions | Protected Attributes | List of all members
JsonView Class Reference
Inheritance diagram for JsonView:
AbstractView ViewInterface

Public Member Functions

 injectPersistenceManager (\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface $persistenceManager)
 
 injectReflectionService (\TYPO3\CMS\Extbase\Reflection\ReflectionService $reflectionService)
 
 setVariablesToRender (array $variablesToRender)
 
 setConfiguration (array $configuration)
 
- Public Member Functions inherited from AbstractView
 setControllerContext (\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
 
 assign ($key, $value)
 
 assignMultiple (array $values)
 
 canRender (\TYPO3\CMS\Extbase\Mvc\Controller\ControllerContext $controllerContext)
 
 initializeView ()
 
- Public Member Functions inherited from ViewInterface
 render ()
 

Public Attributes

const EXPOSE_CLASSNAME_FULLY_QUALIFIED = 1
 
const EXPOSE_CLASSNAME_UNQUALIFIED = 2
 

Protected Member Functions

 renderArray ()
 
 transformValue ($value, array $configuration)
 
 transformObject ($object, array $configuration)
 

Protected Attributes

 $reflectionService
 
 $controllerContext
 
 $variablesToRender = array('value')
 
 $configuration = array()
 
 $persistenceManager
 
- Protected Attributes inherited from AbstractView
 $controllerContext
 
 $variables = array()
 

Detailed Description

A JSON view

Definition at line 25 of file extbase/Classes/Mvc/View/JsonView.php.

Member Function Documentation

injectPersistenceManager ( \TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface  $persistenceManager)
Parameters
\TYPO3\CMS\Extbase\Persistence\PersistenceManagerInterface$persistenceManager

Definition at line 168 of file extbase/Classes/Mvc/View/JsonView.php.

References JsonView\$persistenceManager.

injectReflectionService ( \TYPO3\CMS\Extbase\Reflection\ReflectionService  $reflectionService)
Parameters
\TYPO3\CMS\Extbase\Reflection\ReflectionService$reflectionService

Definition at line 176 of file extbase/Classes/Mvc/View/JsonView.php.

References JsonView\$reflectionService.

renderArray ( )
protected

Loads the configuration and transforms the value to a serializable array.

Returns
array An array containing the values, ready to be JSON encoded

Definition at line 244 of file extbase/Classes/Mvc/View/JsonView.php.

References JsonView\$configuration, and JsonView\transformValue().

setConfiguration ( array  $configuration)
Parameters
array$configurationThe rendering configuration for this JSON view
Returns
void

Definition at line 198 of file extbase/Classes/Mvc/View/JsonView.php.

References JsonView\$configuration.

setVariablesToRender ( array  $variablesToRender)

Specifies which variables this JsonView should render By default only the variable 'value' will be rendered

Parameters
array$variablesToRender
Returns
void

Definition at line 189 of file extbase/Classes/Mvc/View/JsonView.php.

References JsonView\$variablesToRender.

transformObject (   $object,
array  $configuration 
)
protected

Traverses the given object structure in order to transform it into an array structure.

Parameters
object$objectObject to traverse
array$configurationConfiguration for transforming the given object or NULL
Returns
array Object structure as an array

Definition at line 301 of file extbase/Classes/Mvc/View/JsonView.php.

References elseif, and JsonView\transformValue().

Referenced by JsonView\transformValue().

transformValue (   $value,
array  $configuration 
)
protected

Transforms a value depending on type recursively using the supplied configuration.

Parameters
mixed$valueThe value to transform
array$configurationConfiguration for transforming the value
Returns
array The transformed value

Definition at line 268 of file extbase/Classes/Mvc/View/JsonView.php.

References elseif, and JsonView\transformObject().

Referenced by JsonView\renderArray(), and JsonView\transformObject().

Member Data Documentation

$configuration = array()
protected
$controllerContext
protected

Definition at line 51 of file extbase/Classes/Mvc/View/JsonView.php.

$persistenceManager
protected
$reflectionService
protected
$variablesToRender = array('value')
protected

Definition at line 58 of file extbase/Classes/Mvc/View/JsonView.php.

Referenced by JsonView\setVariablesToRender().

const EXPOSE_CLASSNAME_FULLY_QUALIFIED = 1

Definition for the class name exposure configuration, that is, if the class name of an object should also be part of the output JSON, if configured.

Setting this value, the object's class name is fully put out, including the namespace.

Definition at line 35 of file extbase/Classes/Mvc/View/JsonView.php.

const EXPOSE_CLASSNAME_UNQUALIFIED = 2

Puts out only the actual class name without namespace. See EXPOSE_CLASSNAME_FULL for the meaning of the constant at all.

Definition at line 41 of file extbase/Classes/Mvc/View/JsonView.php.