eZPublishCommunityProject  2013.4
eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator Class Reference

Public Member Functions

 generateHashValue ($parent, $hashElementName, $hashValue)
 Generates the field type value $hashValue as a child of the given Object using $hashElementName as the property name. More...
 

Protected Member Functions

 generateArrayValue ($parent, array $value)
 Generates and returns a JSON structure (array or object) depending on $value type with $parent. More...
 
 generateHashArray ($parent, array $hashArray)
 Generates a JSON object from the given $hashArray with $parent. More...
 
 generateListArray ($parent, array $listArray)
 Generates a JSON array from the given $hashArray with $parent. More...
 
 generateValue ($parent, $value)
 Generates and returns a value based on $hashValue type, with $parent ( if the type of $hashValue supports it) More...
 
 isNumericArray (array $value)
 Checks if the given $value is a purely numeric array. More...
 

Member Function Documentation

eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator::generateArrayValue (   $parent,
array  $value 
)
protected

Generates and returns a JSON structure (array or object) depending on $value type with $parent.

If $type only contains numeric keys, the resulting structure will be an JSON array, otherwise a JSON object

Parameters
\eZ\Publish\Core\REST\Common\Output\Generator\Json\ArrayObject | \eZ\Publish\Core\REST\Common\Output\Generator\Json\Object$parent
array$value
Returns
|

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator\generateValue().

eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator::generateHashArray (   $parent,
array  $hashArray 
)
protected

Generates a JSON object from the given $hashArray with $parent.

Parameters
\eZ\Publish\Core\REST\Common\Output\Generator\Json\ArrayObject | \eZ\Publish\Core\REST\Common\Output\Generator\Json\Object$parent
array$hashArray
Returns

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator\generateArrayValue().

eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator::generateHashValue (   $parent,
  $hashElementName,
  $hashValue 
)

Generates the field type value $hashValue as a child of the given Object using $hashElementName as the property name.

Parameters
\eZ\Publish\Core\REST\Common\Output\Generator\Json\ArrayObject | \eZ\Publish\Core\REST\Common\Output\Generator\Json\Object$parent
string$hashElementName
mixed$hashValue
eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator::generateListArray (   $parent,
array  $listArray 
)
protected

Generates a JSON array from the given $hashArray with $parent.

Parameters
\eZ\Publish\Core\REST\Common\Output\Generator\Json\ArrayObject | \eZ\Publish\Core\REST\Common\Output\Generator\Json\Object$parent
array$listArray
Returns

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator\generateArrayValue().

eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator::generateValue (   $parent,
  $value 
)
protected

Generates and returns a value based on $hashValue type, with $parent ( if the type of $hashValue supports it)

Parameters
\eZ\Publish\Core\REST\Common\Output\Generator\Json\ArrayObject | \eZ\Publish\Core\REST\Common\Output\Generator\Json\Object$parent
mixed$value
Returns
mixed

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator\generateHashArray(), eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator\generateHashValue(), and eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator\generateListArray().

eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator::isNumericArray ( array  $value)
protected

Checks if the given $value is a purely numeric array.

Parameters
array$value
Returns
boolean

Referenced by eZ\Publish\Core\REST\Common\Output\Generator\Json\FieldTypeHashGenerator\generateArrayValue().


The documentation for this class was generated from the following file: