PHP Class Sulu\Component\Content\SimpleContentType

Inheritance: implements Sulu\Component\Content\ContentTypeInterface
Mostra file Open project: sulu/sulu Class Usage Examples

Protected Properties

Property Type Description
$defaultValue mixed default value if node does not have the property.

Public Methods

Method Description
__construct ( $name, $defaultValue = null )
__get ( $property ) magic getter for twig templates.
exportData ( $propertyValue )
getContentData ( Sulu\Component\Content\Compat\PropertyInterface $property )
getDefaultParams ( Sulu\Component\Content\Compat\PropertyInterface $property = null )
getDefaultValue ( )
getName ( ) : string Returns the name of the content type.
getReferencedUuids ( Sulu\Component\Content\Compat\PropertyInterface $property )
getType ( )
getViewData ( Sulu\Component\Content\Compat\PropertyInterface $property )
hasValue ( PHPCR\NodeInterface $node, Sulu\Component\Content\Compat\PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey )
importData ( PHPCR\NodeInterface $node, Sulu\Component\Content\Compat\PropertyInterface $property, $value, $userId, $webspaceKey, $languageCode, $segmentKey = null )
read ( PHPCR\NodeInterface $node, Sulu\Component\Content\Compat\PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey )
remove ( PHPCR\NodeInterface $node, Sulu\Component\Content\Compat\PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey )
write ( PHPCR\NodeInterface $node, Sulu\Component\Content\Compat\PropertyInterface $property, $userId, $webspaceKey, $languageCode, $segmentKey )

Protected Methods

Method Description
decodeValue ( mixed $value ) : mixed Decodes value from database.
encodeValue ( mixed $value ) : mixed Prepares value for database.
removeIllegalCharacters ( string $content ) : string Remove illegal characters from content string, else PHPCR would throw an PHPCR\ValueFormatException if an illegal characters is detected.

Method Details

__construct() public method

public __construct ( $name, $defaultValue = null )

__get() public method

magic getter for twig templates.
public __get ( $property )
$property string name of property

decodeValue() protected method

Decodes value from database.
protected decodeValue ( mixed $value ) : mixed
$value mixed
return mixed

encodeValue() protected method

Prepares value for database.
protected encodeValue ( mixed $value ) : mixed
$value mixed
return mixed

exportData() public method

public exportData ( $propertyValue )

getContentData() public method

public getContentData ( Sulu\Component\Content\Compat\PropertyInterface $property )
$property Sulu\Component\Content\Compat\PropertyInterface

getDefaultParams() public method

public getDefaultParams ( Sulu\Component\Content\Compat\PropertyInterface $property = null )
$property Sulu\Component\Content\Compat\PropertyInterface

getDefaultValue() public method

public getDefaultValue ( )

getName() public method

Returns the name of the content type.
public getName ( ) : string
return string

getReferencedUuids() public method

public getReferencedUuids ( Sulu\Component\Content\Compat\PropertyInterface $property )
$property Sulu\Component\Content\Compat\PropertyInterface

getType() public method

public getType ( )

getViewData() public method

public getViewData ( Sulu\Component\Content\Compat\PropertyInterface $property )
$property Sulu\Component\Content\Compat\PropertyInterface

hasValue() public method

public hasValue ( PHPCR\NodeInterface $node, Sulu\Component\Content\Compat\PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey )
$node PHPCR\NodeInterface
$property Sulu\Component\Content\Compat\PropertyInterface

importData() public method

public importData ( PHPCR\NodeInterface $node, Sulu\Component\Content\Compat\PropertyInterface $property, $value, $userId, $webspaceKey, $languageCode, $segmentKey = null )
$node PHPCR\NodeInterface
$property Sulu\Component\Content\Compat\PropertyInterface

read() public method

public read ( PHPCR\NodeInterface $node, Sulu\Component\Content\Compat\PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey )
$node PHPCR\NodeInterface
$property Sulu\Component\Content\Compat\PropertyInterface

remove() public method

public remove ( PHPCR\NodeInterface $node, Sulu\Component\Content\Compat\PropertyInterface $property, $webspaceKey, $languageCode, $segmentKey )
$node PHPCR\NodeInterface
$property Sulu\Component\Content\Compat\PropertyInterface

removeIllegalCharacters() protected method

Remove illegal characters from content string, else PHPCR would throw an PHPCR\ValueFormatException if an illegal characters is detected.
protected removeIllegalCharacters ( string $content ) : string
$content string
return string

write() public method

public write ( PHPCR\NodeInterface $node, Sulu\Component\Content\Compat\PropertyInterface $property, $userId, $webspaceKey, $languageCode, $segmentKey )
$node PHPCR\NodeInterface
$property Sulu\Component\Content\Compat\PropertyInterface

Property Details

$defaultValue protected_oe property

default value if node does not have the property.
protected mixed $defaultValue
return mixed