interface ColorItemInterface in Color API 8
Interface for Field API Color items.
Hierarchy
- interface \Drupal\Core\TypedData\TypedDataInterface
- interface \Drupal\Core\TypedData\TraversableTypedDataInterface extends \Drupal\Core\TypedData\Traversable
- interface \Drupal\Core\TypedData\ComplexDataInterface
- interface \Drupal\Core\Field\FieldItemInterface
- interface \Drupal\colorapi\Plugin\Field\FieldType\ColorItemInterface
- interface \Drupal\Core\Field\FieldItemInterface
- interface \Drupal\Core\TypedData\ComplexDataInterface
- interface \Drupal\Core\TypedData\TraversableTypedDataInterface extends \Drupal\Core\TypedData\Traversable
Expanded class hierarchy of ColorItemInterface
All classes that implement ColorItemInterface
File
- src/
Plugin/ Field/ FieldType/ ColorItemInterface.php, line 10
Namespace
Drupal\colorapi\Plugin\Field\FieldTypeView source
interface ColorItemInterface extends FieldItemInterface {
/**
* Set the human-readable 'name' proprty of the Color Field item.
*
* @param string $name
* The human-readable name of the color. Example "Red" or "Blue".
* @param bool $notify
* Whether to notify the parent object of the change. Defaults to TRUE. If a
* property is updated from a parent object, set it to FALSE to avoid being
* notified again.
*/
public function setName($name, $notify = TRUE);
/**
* Retrieve the human-readable name of the color.
*
* @return string
* The human-readable name of the color.
*/
public function getColorName();
/**
* Set the human-readable 'name' proprty of the Color Field item.
*
* @param array $color
* An array of values to be set for the color. Values will be set based on
* the keys:
* - hexadecimal: The hexadecimal color string representing the color.
* - rgb: An array containing the following values:
* - red: The value for the RGB "red". An integer between 0 and 255.
* - green: The value for the RGB "green". An integer between 0 and
* 255.
* - blue: The value for the RGB "blue". An integer between 0 and 255.
* @param bool $notify
* Whether to notify the parent object of the change. Defaults to TRUE. If a
* property is updated from a parent object, set it to FALSE to avoid being
* notified again.
*/
public function setColor(array $color, $notify = TRUE);
/**
* Retrieve the color array for the Color Field item.
*
* @return array
* An array containing the following keys:
* - hexadecimal: The hexadecimal string representation of the color.
* - rgb: An array containing the following values:
* - red: The value for the RGB "red". An integer between 0 and 255.
* - green: The value for the RGB "green". An integer between 0 and
* 255.
* - blue: The value for the RGB "blue". An integer between 0 and 255.
*/
public function getColor();
/**
* Set the 'hexadecimal' property of the Color Field 'Color' property.
*
* @param string $color
* The hexadecimal string value representing the color.
* @param bool $notify
* Whether to notify the parent object of the change. Defaults to TRUE. If a
* property is updated from a parent object, set it to FALSE to avoid being
* notified again.
*/
public function setHexadecimal($color, $notify = TRUE);
/**
* Retrieve the hexadecimal color string representation of the color.
*
* @return string
* The hexadecimal string representation of the color.
*/
public function getHexadecimal();
/**
* Set the 'rgb' property of the Color Field 'Color' property.
*
* @param array $rgb
* An array containing the following values:
* - red: The value for the RGB "red". An integer between 0 and 255.
* - green: The value for the RGB "green". An integer between 0 and
* 255.
* - blue: The value for the RGB "blue". An integer between 0 and 255.
* @param bool $notify
* Whether to notify the parent object of the change. Defaults to TRUE. If a
* property is updated from a parent object, set it to FALSE to avoid being
* notified again.
*/
public function setRgb(array $rgb, $notify = TRUE);
/**
* Retrieve RGB value array of the Color Field Color data object.
*
* @return array
* An array containing the following keys:
* - red: The value for the RGB "red". An integer between 0 and 255.
* - green: The value for the RGB "green". An integer between 0 and
* 255.
* - blue: The value for the RGB "blue". An integer between 0 and 255.
*/
public function getRgb();
/**
* Set 'red' property of the Color Field 'Color' property's 'RGB' property.
*
* @param string $red
* The value for the RGB "red" property. An integer between 0 and 255.
* @param bool $notify
* Whether to notify the parent object of the change. Defaults to TRUE. If a
* property is updated from a parent object, set it to FALSE to avoid being
* notified again.
*/
public function setRed($red, $notify = TRUE);
/**
* Retrieve 'Red' value of the Color Field Color data object RGB property.
*
* @return array
* The value for the RGB "red". An integer between 0 and 255.
*/
public function getRed();
/**
* Set 'green' property of the Color Field 'Color' property's 'RGB' property.
*
* @param string $green
* The value for the RGB "green" property. An integer between 0 and 255.
* @param bool $notify
* Whether to notify the parent object of the change. Defaults to TRUE. If a
* property is updated from a parent object, set it to FALSE to avoid being
* notified again.
*/
public function setGreen($green, $notify = TRUE);
/**
* Retrieve 'Green' value of the Color Field Color data object RGB property.
*
* @return array
* The value for the RGB "red". An integer between 0 and 255.
*/
public function getGreen();
/**
* Set 'blue' property of the Color Field 'Color' property's 'RGB' property.
*
* @param string $blue
* The value for the RGB "blue" property. An integer between 0 and 255.
* @param bool $notify
* Whether to notify the parent object of the change. Defaults to TRUE. If a
* property is updated from a parent object, set it to FALSE to avoid being
* notified again.
*/
public function setBlue($blue, $notify = TRUE);
/**
* Retrieve 'Blue' value of the Color Field Color data object RGB property.
*
* @return array
* The value for the RGB "red". An integer between 0 and 255.
*/
public function getBlue();
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
ColorItemInterface:: |
public | function | Retrieve 'Blue' value of the Color Field Color data object RGB property. | 1 |
ColorItemInterface:: |
public | function | Retrieve the color array for the Color Field item. | 1 |
ColorItemInterface:: |
public | function | Retrieve the human-readable name of the color. | 1 |
ColorItemInterface:: |
public | function | Retrieve 'Green' value of the Color Field Color data object RGB property. | 1 |
ColorItemInterface:: |
public | function | Retrieve the hexadecimal color string representation of the color. | 1 |
ColorItemInterface:: |
public | function | Retrieve 'Red' value of the Color Field Color data object RGB property. | 1 |
ColorItemInterface:: |
public | function | Retrieve RGB value array of the Color Field Color data object. | 1 |
ColorItemInterface:: |
public | function | Set 'blue' property of the Color Field 'Color' property's 'RGB' property. | 1 |
ColorItemInterface:: |
public | function | Set the human-readable 'name' proprty of the Color Field item. | 1 |
ColorItemInterface:: |
public | function | Set 'green' property of the Color Field 'Color' property's 'RGB' property. | 1 |
ColorItemInterface:: |
public | function | Set the 'hexadecimal' property of the Color Field 'Color' property. | 1 |
ColorItemInterface:: |
public | function | Set the human-readable 'name' proprty of the Color Field item. | 1 |
ColorItemInterface:: |
public | function | Set 'red' property of the Color Field 'Color' property's 'RGB' property. | 1 |
ColorItemInterface:: |
public | function | Set the 'rgb' property of the Color Field 'Color' property. | 1 |
ComplexDataInterface:: |
public | function | Gets a property object. | 2 |
ComplexDataInterface:: |
public | function |
Gets the data definition. Overrides TypedDataInterface:: |
|
ComplexDataInterface:: |
public | function | Gets an array of property objects. | 3 |
ComplexDataInterface:: |
public | function | Determines whether the data structure is empty. | 2 |
ComplexDataInterface:: |
public | function | Sets a property value. | 3 |
ComplexDataInterface:: |
public | function | Returns an array of all property values. | 2 |
FieldItemInterface:: |
public static | function | Calculates dependencies for field items. | 1 |
FieldItemInterface:: |
public static | function | Calculates dependencies for field items on the storage level. | 1 |
FieldItemInterface:: |
public static | function | Defines the field-level settings for this plugin. | 1 |
FieldItemInterface:: |
public static | function | Defines the storage-level settings for this plugin. | 1 |
FieldItemInterface:: |
public | function | Defines custom delete behavior for field values. | 1 |
FieldItemInterface:: |
public | function | Defines custom revision delete behavior for field values. | 1 |
FieldItemInterface:: |
public | function | Returns a form for the field-level settings. | 1 |
FieldItemInterface:: |
public static | function | Returns a settings array in the field type's canonical representation. | 1 |
FieldItemInterface:: |
public static | function | Returns a settings array that can be stored as a configuration value. | 1 |
FieldItemInterface:: |
public static | function | Generates placeholder field values. | 1 |
FieldItemInterface:: |
public | function | Gets the entity that field belongs to. | 1 |
FieldItemInterface:: |
public | function | Gets the field definition. | 1 |
FieldItemInterface:: |
public | function | Gets the langcode of the field values held in the object. | 1 |
FieldItemInterface:: |
public static | function | Returns the name of the main property, if any. | 1 |
FieldItemInterface:: |
public static | function | Informs the plugin that a dependency of the field will be deleted. | 1 |
FieldItemInterface:: |
public | function | Defines custom post-save behavior for field values. | 1 |
FieldItemInterface:: |
public | function | Defines custom presave behavior for field values. | 1 |
FieldItemInterface:: |
public static | function | Defines field item properties. | 28 |
FieldItemInterface:: |
public static | function | Returns the schema for the field. | 31 |
FieldItemInterface:: |
public | function | Returns a form for the storage-level settings. | 1 |
FieldItemInterface:: |
public static | function | Returns a settings array in the field type's canonical representation. | 1 |
FieldItemInterface:: |
public static | function | Returns a settings array that can be stored as a configuration value. | 1 |
FieldItemInterface:: |
public | function | Returns a renderable array for a single field item. | 1 |
FieldItemInterface:: |
public | function | Magic method: Gets a property value. | 1 |
FieldItemInterface:: |
public | function | Magic method: Determines whether a property is set. | 1 |
FieldItemInterface:: |
public | function | Magic method: Sets a property value. | 1 |
FieldItemInterface:: |
public | function | Magic method: Unsets a property. | 1 |
TraversableTypedDataInterface:: |
public | function | React to changes to a child property or item. | 4 |
TypedDataInterface:: |
public | function | Applies the default value. | 1 |
TypedDataInterface:: |
public static | function | Constructs a TypedData object given its definition and context. | 1 |
TypedDataInterface:: |
public | function | Gets a list of validation constraints. | 1 |
TypedDataInterface:: |
public | function | Returns the name of a property or item. | 1 |
TypedDataInterface:: |
public | function | Returns the parent data structure; i.e. either complex data or a list. | 1 |
TypedDataInterface:: |
public | function | Returns the property path of the data. | 1 |
TypedDataInterface:: |
public | function | Returns the root of the typed data tree. | 1 |
TypedDataInterface:: |
public | function | Returns a string representation of the data. | 1 |
TypedDataInterface:: |
public | function | Gets the data value. | 1 |
TypedDataInterface:: |
public | function | Sets the context of a property or item via a context aware parent. | 1 |
TypedDataInterface:: |
public | function | Sets the data value. | 1 |
TypedDataInterface:: |
public | function | Validates the currently set data value. | 1 |