| @@ 74-88 (lines=15) @@ | ||
| 71 | /** |
|
| 72 | * {@inheritdoc} |
|
| 73 | */ |
|
| 74 | public function append($key, $value = '') |
|
| 75 | { |
|
| 76 | $this->storage += array( |
|
| 77 | $key => new Attribute( |
|
| 78 | $key, |
|
| 79 | $this->ensureString($value) |
|
| 80 | ) |
|
| 81 | ); |
|
| 82 | ||
| 83 | foreach ($this->normalizeValue($value) as $value_item) { |
|
| 84 | $this->storage[$key]->append($value_item); |
|
| 85 | } |
|
| 86 | ||
| 87 | return $this; |
|
| 88 | } |
|
| 89 | ||
| 90 | /** |
|
| 91 | * {@inheritdoc} |
|
| @@ 152-167 (lines=16) @@ | ||
| 149 | /** |
|
| 150 | * {@inheritdoc} |
|
| 151 | */ |
|
| 152 | public function merge(array $data = array()) |
|
| 153 | { |
|
| 154 | foreach ($data as $key => $value) { |
|
| 155 | $this->storage += array( |
|
| 156 | $key => new Attribute( |
|
| 157 | $key |
|
| 158 | ) |
|
| 159 | ); |
|
| 160 | ||
| 161 | $this->storage[$key]->merge( |
|
| 162 | $this->normalizeValue($value) |
|
| 163 | ); |
|
| 164 | } |
|
| 165 | ||
| 166 | return $this; |
|
| 167 | } |
|
| 168 | ||
| 169 | /** |
|
| 170 | * {@inheritdoc} |
|