class DsAttribute in Display Suite 8.2
Same name and namespace in other branches
- 8.4 src/DsAttribute.php \Drupal\ds\DsAttribute
- 8.3 src/DsAttribute.php \Drupal\ds\DsAttribute
Extends the core Attribute object.
Hierarchy
- class \Drupal\Core\Template\Attribute implements \Drupal\Core\Template\ArrayAccess, \Drupal\Core\Template\IteratorAggregate, MarkupInterface
- class \Drupal\ds\DsAttribute
Expanded class hierarchy of DsAttribute
File
- src/
DsAttribute.php, line 10
Namespace
Drupal\dsView source
class DsAttribute extends Attribute {
/**
* Merges Attributes objects into another one.
*
* @return \Drupal\ds\DsAttribute
* Merged attributes.
*/
public function mergeAttributes() {
$args = func_get_args();
if ($args) {
$merged_array = $this
->toArray();
foreach ($args as $arg) {
if (is_object($arg)) {
$merged_array = array_merge_recursive($merged_array, $arg
->toArray());
}
}
foreach ($merged_array as $attribute => $value) {
$this
->setAttribute($attribute, $value);
}
}
return $this;
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
Attribute:: |
protected | property | Stores the attribute data. | |
Attribute:: |
public | function | Adds classes or merges them on to array of existing CSS classes. | |
Attribute:: |
protected | function | Creates the different types of attribute values. | |
Attribute:: |
public | function | Gets the class attribute value if set. | |
Attribute:: |
public | function | ||
Attribute:: |
public | function | Checks if the storage has an attribute with the given name. | |
Attribute:: |
public | function | Checks if the class array has the given CSS class. | |
Attribute:: |
public | function | Returns a representation of the object for use in JSON serialization. | |
Attribute:: |
public | function | Merges an Attribute object into the current storage. | |
Attribute:: |
public | function | ||
Attribute:: |
public | function | ||
Attribute:: |
public | function | ||
Attribute:: |
public | function | ||
Attribute:: |
public | function | Removes an attribute from an Attribute object. | |
Attribute:: |
public | function | Removes argument values from array of existing CSS classes. | |
Attribute:: |
public | function | Sets values for an attribute key. | |
Attribute:: |
public | function | Returns the whole array. | |
Attribute:: |
public | function | Returns all storage elements as an array. | |
Attribute:: |
public | function | Implements the magic __clone() method. | |
Attribute:: |
public | function | Constructs a \Drupal\Core\Template\Attribute object. | |
Attribute:: |
public | function |
Implements the magic __toString() method. Overrides MarkupInterface:: |
|
DsAttribute:: |
public | function | Merges Attributes objects into another one. |