Add and merge in a Collection or array of key value pair data.
Collection|array $data Associative array of key value pair data:
Collection Returns a reference to the object.
public function merge($data) {
if ($data instanceof self) {
$data = $data
->getAll();
}
elseif (!is_array($data)) {
return $this;
}
if (empty($this->data)) {
$this->data = $data;
}
else {
foreach ($data as $key => $value) {
$this
->add($key, $value);
}
}
return $this;
}