Prado\Collections\TMap::copyFrom PHP Метод

copyFrom() публичный Метод

Note, existing data in the map will be cleared first.
public copyFrom ( $data )
    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');
            }
        }
    }