...
Property | Type | Description |
---|
$value | string[]|string
| This property will be used to store multiple comma separated keywords, or single keywords, provided as a string | Holds an array of keywords as strings. |
Code Block |
---|
language | php |
---|
title | Value object content example |
---|
linenumbers | true |
---|
|
use eZ\Publish\Core\FieldType\Keyword\Value;
// Instantiates a Value object
$keywordValue = new Value();
// Sets an array of keywords as a value
$keyword->value = array( "php", "css3", "html5", "eZ Publish" ); |
Constructor
The Keyword
\Value
constructor will initialize a new Value object with the value provided.
It expects a list of keywords, either as comma separated in a string or as an array of strings.
Code Block |
---|
language | php |
---|
title | Constructor example |
---|
linenumbers | true |
---|
|
use eZ\Publish\Core\FieldType\Keyword\Value;
// Instantiates a Keyword Value object with an array of keywords
$keywordValue = new Keyword\Value( array( "php5", "css3", "html5," solr, memcached") );
// Instantiates a Value object with a list of keywords in a string
// This is equivalent to the example above
$keywordValue = new Value( "php5,css3,html5" ); |