public function copyFrom($data)
{
if (is_array($data) || $data instanceof Traversable) {
if ($this->getCount() > 0) {
$this->clear();
}
foreach ($data as $key => $value) {
$this->add($key, $value);
}
} else {
if ($data !== null) {
throw new TInvalidDataTypeException('map_data_not_iterable');
}
}
}