PHP Class Pimcore\Model\Object\ClassDefinition\Data

Show file Open project: pimcore/pimcore Class Usage Examples

Public Properties

Property Type Description
$columnType string | array | array
$datatype string
$fieldtype string
$index integer
$invisible boolean
$locked boolean
$mandatory boolean
$name string
$noteditable boolean
$permissions array
$queryColumnType string | array | array
$relationType boolean
$style boolean
$title string
$tooltip string
$validFilterOperators array
$visibleGridView boolean
$visibleSearch boolean

Protected Properties

Property Type Description
$dropNullValues If set to true then null values will not be exported.

Public Methods

Method Description
adoptMasterDefinition ( Data $masterDefinition )
checkValidity ( mixed $data, boolean $omitMandatoryCheck = false ) Checks if data is valid for current data field
getAsFloatCast ( $number ) : float
getAsIntegerCast ( $number ) : integer | null
getCacheTags ( mixed $data, array $tags = [] ) : array This is a dummy and is mostly implemented by relation types
getColumnType ( ) : string | array
getDataForEditmode ( mixed $data, null | AbstractObject $object = null, mixed $params = [] ) : mixed Returns the data for the editmode
getDataForSearchIndex ( $object, mixed $params = [] ) : string
getDataFromEditmode ( mixed $data, null | AbstractObject $object = null, mixed $params = [] ) : mixed Converts data from editmode to internal eg. Image-Id to Asset\Image object
getDatatype ( ) : string
getDiffDataForEditMode ( mixed $data, null | AbstractObject $object = null, mixed $params = [] ) : null | array Returns the data for the editmode in the format expected by the object merger plugin.
getDiffDataFromEditmode ( $data, null $object = null, mixed $params = [] ) : mixed Converts the data sent from the object merger plugin back to the internal object. Similar to getDiffDataForEditMode() an array of data elements is passed in containing the following attributes: - "field" => the name of (this) field - "key" => the key of the data element - "data" => the data
getDropNullValues ( )
getFieldtype ( ) : string
getFilterCondition ( $value, $operator ) : string returns sql query statement to filter according to this data types value(s)
getFilterConditionExt ( $value, $operator, $params = [] ) : string returns sql query statement to filter according to this data types value(s)
getForCsvExport ( AbstractObject $object, array $params = [] ) : string converts object data to a simple string value or CSV Export
getForWebserviceExport ( AbstractObject $object, mixed $params = [] ) : mixed converts data to be exposed via webservices
getFromCsvImport ( $importValue, null | AbstractObject $object = null, mixed $params = [] ) : mixed
getFromWebserviceImport ( mixed $value, null | AbstractObject $object = null, mixed $params = [], $idMapper = null ) : mixed converts data to be imported via webservices
getGetterCode ( $class ) : string Creates getter code which is used for generation of php file for object classes using this data type
getGetterCodeFieldcollection ( $fieldcollectionDefinition ) : string Creates getter code which is used for generation of php file for fieldcollectionk classes using this data type
getGetterCodeLocalizedfields ( $class ) : string Creates getter code which is used for generation of php file for localized fields in classes using this data type
getGetterCodeObjectbrick ( $brickClass ) : string Creates getter code which is used for generation of php file for object brick classes using this data type
getIndex ( ) : integer
getInvisible ( ) : boolean
getLocked ( ) : boolean
getMandatory ( ) : boolean
getName ( ) : string
getNoteditable ( ) : boolean
getPermissions ( ) : array
getPhpdocType ( ) : string
getQueryColumnType ( ) : string | array
getSetterCode ( $class ) : string Creates setter code which is used for generation of php file for object classes using this data type
getSetterCodeFieldcollection ( $fieldcollectionDefinition ) : string Creates setter code which is used for generation of php file for fieldcollection classes using this data type
getSetterCodeLocalizedfields ( $class ) : string Creates setter code which is used for generation of php file for localized fields in classes using this data type
getSetterCodeObjectbrick ( $brickClass ) : string Creates setter code which is used for generation of php file for object brick classes using this data type
getStyle ( ) : boolean
getTitle ( ) : string
getTooltip ( ) : string
getVersionPreview ( $data, null | AbstractObject $object = null, mixed $params = [] ) : string
getVisibleGridView ( ) : boolean
getVisibleSearch ( ) : boolean
isDiffChangeAllowed ( string $object, mixed $params = [] ) : boolean True if change is allowed in edit mode.
isEmpty ( Concrete $data ) : boolean
isRelationType ( ) : boolean
marshal ( mixed $value, AbstractObject $object = null, mixed $params = [] ) : mixed Encode value for packing it into a single column.
resolveDependencies ( $data ) : array
setColumnType ( string | array $columnType )
setDatatype ( string $datatype )
setDropNullValues ( $dropNullValues )
setFieldtype ( string $fieldtype )
setIndex ( integer $index )
setInvisible ( $invisible )
setLocked ( $locked )
setMandatory ( boolean $mandatory )
setName ( string $name )
setNoteditable ( boolean $noteditable )
setPermissions ( array $permissions )
setQueryColumnType ( string | array $queryColumnType )
setStyle ( $style )
setTitle ( string $title )
setTooltip ( $tooltip )
setValues ( array $data = [] )
setVisibleGridView ( $visibleGridView )
setVisibleSearch ( $visibleSearch )
synchronizeWithMasterDefinition ( Data $masterDefinition )
unmarshal ( $data, AbstractObject $object = null, $params = [] ) : mixed See marshal

Protected Methods

Method Description
getDataFromObjectParam ( $object, array $params = [] ) : mixed

Method Details

adoptMasterDefinition() public method

public adoptMasterDefinition ( Data $masterDefinition )
$masterDefinition Data

checkValidity() public method

Checks if data is valid for current data field
public checkValidity ( mixed $data, boolean $omitMandatoryCheck = false )
$data mixed
$omitMandatoryCheck boolean

getAsFloatCast() public method

public getAsFloatCast ( $number ) : float
$number
return float

getAsIntegerCast() public method

public getAsIntegerCast ( $number ) : integer | null
$number
return integer | null

getCacheTags() public method

This is a dummy and is mostly implemented by relation types
public getCacheTags ( mixed $data, array $tags = [] ) : array
$data mixed
$tags array
return array

getColumnType() public method

public getColumnType ( ) : string | array
return string | array | array

getDataForEditmode() abstract public method

Returns the data for the editmode
abstract public getDataForEditmode ( mixed $data, null | AbstractObject $object = null, mixed $params = [] ) : mixed
$data mixed
$object null | Pimcore\Model\Object\AbstractObject
$params mixed
return mixed

getDataForSearchIndex() public method

public getDataForSearchIndex ( $object, mixed $params = [] ) : string
$object
$params mixed
return string

getDataFromEditmode() abstract public method

Converts data from editmode to internal eg. Image-Id to Asset\Image object
abstract public getDataFromEditmode ( mixed $data, null | AbstractObject $object = null, mixed $params = [] ) : mixed
$data mixed
$object null | Pimcore\Model\Object\AbstractObject
$params mixed
return mixed

getDataFromObjectParam() protected method

protected getDataFromObjectParam ( $object, array $params = [] ) : mixed
$object
$params array
return mixed

getDatatype() public method

public getDatatype ( ) : string
return string

getDiffDataForEditMode() public method

The return value is a list of data definitions containing the following attributes: - "field" => the name of the object field - "key" => a unique key identifying the data element - "type" => the type of the data component - "value" => the value used as preview - "data" => the actual data which is then sent back again by the editor. Note that the data is opaque and will not be touched by the editor in any way. - "disabled" => whether the data element can be edited or not - "title" => pretty name describing the data element
public getDiffDataForEditMode ( mixed $data, null | AbstractObject $object = null, mixed $params = [] ) : null | array
$data mixed
$object null | Pimcore\Model\Object\AbstractObject
$params mixed
return null | array

getDiffDataFromEditmode() public method

Converts the data sent from the object merger plugin back to the internal object. Similar to getDiffDataForEditMode() an array of data elements is passed in containing the following attributes: - "field" => the name of (this) field - "key" => the key of the data element - "data" => the data
public getDiffDataFromEditmode ( $data, null $object = null, mixed $params = [] ) : mixed
$data
$object null
$params mixed
return mixed

getDropNullValues() public static method

public static getDropNullValues ( )

getFieldtype() public method

public getFieldtype ( ) : string
return string

getFilterCondition() public method

returns sql query statement to filter according to this data types value(s)
public getFilterCondition ( $value, $operator ) : string
$value
$operator
return string

getFilterConditionExt() public method

returns sql query statement to filter according to this data types value(s)
public getFilterConditionExt ( $value, $operator, $params = [] ) : string
$value
$operator
$params optional params used to change the behavior
return string

getForCsvExport() public method

converts object data to a simple string value or CSV Export
public getForCsvExport ( AbstractObject $object, array $params = [] ) : string
$object Pimcore\Model\Object\AbstractObject
$params array
return string

getForWebserviceExport() public method

converts data to be exposed via webservices
public getForWebserviceExport ( AbstractObject $object, mixed $params = [] ) : mixed
$object Pimcore\Model\Object\AbstractObject
$params mixed
return mixed

getFromCsvImport() public method

public getFromCsvImport ( $importValue, null | AbstractObject $object = null, mixed $params = [] ) : mixed
$importValue
$object null | Pimcore\Model\Object\AbstractObject
$params mixed
return mixed

getFromWebserviceImport() public method

converts data to be imported via webservices
public getFromWebserviceImport ( mixed $value, null | AbstractObject $object = null, mixed $params = [], $idMapper = null ) : mixed
$value mixed
$object null | Pimcore\Model\Object\AbstractObject
$params mixed
return mixed

getGetterCode() public method

Creates getter code which is used for generation of php file for object classes using this data type
public getGetterCode ( $class ) : string
$class
return string

getGetterCodeFieldcollection() public method

Creates getter code which is used for generation of php file for fieldcollectionk classes using this data type
public getGetterCodeFieldcollection ( $fieldcollectionDefinition ) : string
$fieldcollectionDefinition
return string

getGetterCodeLocalizedfields() public method

Creates getter code which is used for generation of php file for localized fields in classes using this data type
public getGetterCodeLocalizedfields ( $class ) : string
$class
return string

getGetterCodeObjectbrick() public method

Creates getter code which is used for generation of php file for object brick classes using this data type
public getGetterCodeObjectbrick ( $brickClass ) : string
$brickClass
return string

getIndex() public method

public getIndex ( ) : integer
return integer

getInvisible() public method

public getInvisible ( ) : boolean
return boolean

getLocked() public method

public getLocked ( ) : boolean
return boolean

getMandatory() public method

public getMandatory ( ) : boolean
return boolean

getName() public method

public getName ( ) : string
return string

getNoteditable() public method

public getNoteditable ( ) : boolean
return boolean

getPermissions() public method

public getPermissions ( ) : array
return array

getPhpdocType() public method

public getPhpdocType ( ) : string
return string

getQueryColumnType() public method

public getQueryColumnType ( ) : string | array
return string | array | array

getSetterCode() public method

Creates setter code which is used for generation of php file for object classes using this data type
public getSetterCode ( $class ) : string
$class
return string

getSetterCodeFieldcollection() public method

Creates setter code which is used for generation of php file for fieldcollection classes using this data type
public getSetterCodeFieldcollection ( $fieldcollectionDefinition ) : string
$fieldcollectionDefinition
return string

getSetterCodeLocalizedfields() public method

Creates setter code which is used for generation of php file for localized fields in classes using this data type
public getSetterCodeLocalizedfields ( $class ) : string
$class
return string

getSetterCodeObjectbrick() public method

Creates setter code which is used for generation of php file for object brick classes using this data type
public getSetterCodeObjectbrick ( $brickClass ) : string
$brickClass
return string

getStyle() public method

public getStyle ( ) : boolean
return boolean

getTitle() public method

public getTitle ( ) : string
return string

getTooltip() public method

public getTooltip ( ) : string
return string

getVersionPreview() public method

public getVersionPreview ( $data, null | AbstractObject $object = null, mixed $params = [] ) : string
$data
$object null | Pimcore\Model\Object\AbstractObject
$params mixed
return string

getVisibleGridView() public method

public getVisibleGridView ( ) : boolean
return boolean

getVisibleSearch() public method

public getVisibleSearch ( ) : boolean
return boolean

isDiffChangeAllowed() public method

True if change is allowed in edit mode.
public isDiffChangeAllowed ( string $object, mixed $params = [] ) : boolean
$object string
$params mixed
return boolean

isEmpty() public method

public isEmpty ( Concrete $data ) : boolean
$data Pimcore\Model\Object\Concrete
return boolean

isRelationType() public method

public isRelationType ( ) : boolean
return boolean

marshal() public method

Encode value for packing it into a single column.
public marshal ( mixed $value, AbstractObject $object = null, mixed $params = [] ) : mixed
$value mixed
$object Pimcore\Model\Object\AbstractObject
$params mixed
return mixed

resolveDependencies() public method

public resolveDependencies ( $data ) : array
$data
return array

setColumnType() public method

public setColumnType ( string | array $columnType )
$columnType string | array

setDatatype() public method

public setDatatype ( string $datatype )
$datatype string

setDropNullValues() public static method

public static setDropNullValues ( $dropNullValues )
$dropNullValues

setFieldtype() public method

public setFieldtype ( string $fieldtype )
$fieldtype string

setIndex() public method

public setIndex ( integer $index )
$index integer

setInvisible() public method

public setInvisible ( $invisible )
$invisible

setLocked() public method

public setLocked ( $locked )
$locked

setMandatory() public method

public setMandatory ( boolean $mandatory )
$mandatory boolean

setName() public method

public setName ( string $name )
$name string

setNoteditable() public method

public setNoteditable ( boolean $noteditable )
$noteditable boolean

setPermissions() public method

public setPermissions ( array $permissions )
$permissions array

setQueryColumnType() public method

public setQueryColumnType ( string | array $queryColumnType )
$queryColumnType string | array

setStyle() public method

public setStyle ( $style )
$style

setTitle() public method

public setTitle ( string $title )
$title string

setTooltip() public method

public setTooltip ( $tooltip )
$tooltip

setValues() public method

public setValues ( array $data = [] )
$data array

setVisibleGridView() public method

public setVisibleGridView ( $visibleGridView )
$visibleGridView

setVisibleSearch() public method

public setVisibleSearch ( $visibleSearch )
$visibleSearch

synchronizeWithMasterDefinition() public method

public synchronizeWithMasterDefinition ( Data $masterDefinition )
$masterDefinition Data

unmarshal() public method

See marshal
public unmarshal ( $data, AbstractObject $object = null, $params = [] ) : mixed
$object Pimcore\Model\Object\AbstractObject
return mixed

Property Details

$columnType public property

| array
public string|array $columnType
return string | array

$datatype public property

public string $datatype
return string

$dropNullValues protected static property

If set to true then null values will not be exported.
protected static $dropNullValues

$fieldtype public property

public string $fieldtype
return string

$index public property

public int $index
return integer

$invisible public property

public bool $invisible
return boolean

$locked public property

public bool $locked
return boolean

$mandatory public property

public bool $mandatory
return boolean

$name public property

public string $name
return string

$noteditable public property

public bool $noteditable
return boolean

$permissions public property

public array $permissions
return array

$queryColumnType public property

| array
public string|array $queryColumnType
return string | array

$relationType public property

public bool $relationType
return boolean

$style public property

public bool $style
return boolean

$title public property

public string $title
return string

$tooltip public property

public string $tooltip
return string

$validFilterOperators public static property

public static array $validFilterOperators
return array

$visibleGridView public property

public bool $visibleGridView
return boolean

$visibleSearch public property

public bool $visibleSearch
return boolean