DsAttribute.php in Display Suite 8.2
File
src/DsAttribute.php
View source
<?php
namespace Drupal\ds;
use Drupal\Core\Template\Attribute;
class DsAttribute extends Attribute {
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;
}
}