Add items

@param  array  $data
@return Request
187710
public function add(array $data = []) : Request
  {
    $this->data = array_merge($this->data, $data);

    $files = array_filter($data, function($file) {
      if (isset($file['type']) && isset($file['name']) && isset($file['size'])) return $file;
    });

    $this->files = array_merge($this->files, $files);
    return $this;
  }
347321
public function add(array $data)
    {
        $result = null;
        $this->hook->attach('category.group.add.before', $data, $result, $this);

        if (isset($result)) {
            return (int) $result;
        }

        $result = $data['category_group_id'] = $this->db->insert('category_group', $data);

        $this->setTranslations($data, $this->translation_entity, 'category_group', false);

        $this->hook->attach('category.group.add.after', $data, $result, $this);
        return (int) $result;
    }
233387
public function import(array $data)
    {
        $this->clearErrors();
        $result = true;

        foreach ($data as $section) {
            if ($this->importItem($section) === false) {
                $result = false;
            }
        }

        return $result;
    }
1086447
public static function fromArray(array $data) {
		$ret = new FormOptions();
		foreach($data as $value => $text) {
			$ret->add($value, $text);
		}
		return $ret;
	}
949718
public function add(array $items) {
		
		foreach($items as $name => $object) {
			$this->set($name, $object);
		}
		
		return $this;
	}
810618
public function add(array $data)
    {
        $result = null;
        $this->hook->attach('language.add.before', $data, $result, $this);

        if (isset($result)) {
            return (bool) $result;
        }

        if (!empty($data['default'])) {
            $this->setDefault($data['code']);
        }

        $default = $this->getDefaultData();
        $data += $default;

        if (empty($data['name'])) {
            $data['name'] = $data['code'];
        }

        if (empty($data['native_name'])) {
            $data['native_name'] = $data['name'];
        }

        $languages = $this->config->select('languages', array());
        $languages[$data['code']] = array_intersect_key($data, $default);

        $result = $this->config->set('languages', $languages);
        $this->hook->attach('language.add.after', $data, $result, $this);
        return (bool) $result;
    }
414629
public function update(array $data)
    {
        $todo = Basecamp::todos($this->bucket->id)->update($this->id, $data);

        $this->setAttributes($todo);

        return $todo;
    }
564777
public function addShelf(array $data)
    {
        $result = $this->httpRaw(self::WECHAT_SHOP_SHELF_ADD_URL . 'access_token=' . $this->getAccessToken(), $data);
        return isset($result['errmsg']) && $result['errmsg'] == 'success' ? $result['shelf_id'] : false;
    }
246773
protected function setRequestData(array $data = [])
    {
        if (($this->post instanceof Collection) && (!$this->post->isEmpty())) {
            unset($this->post);
        }

        $this->post = new Collection($data);

        return $this->post;
    }
962053
public function add(array $data)
    {
        $defaults = array(
            "description" => null,
            "price"       => null,
            "discount"    => null,
            "qty"         => 1,
            "unit"        => null
        );

        $merged = array_merge($defaults, $data);

        $line = $this->create($this->invoiceHandle);

        if( isset($merged['product']) )
        {
            $this->product($line, $merged['product']);
            unset( $merged['product'] );
        }

        return $this->update($data, $line);
    }
1026583
private function addEdgesFromArray(array $data)
    {
        $_edgeClass = $this->_edgeClass;

        $this->_result[] = $_edgeClass::createFromArray($data, $this->_options);
    }
550829
public function add(array $data, array $options = array())
    {
        $result = array();
        $this->hook->attach('order.submit.before', $data, $options, $result, $this);

        if (!empty($result)) {
            return (array) $result;
        }

        $data['order_id'] = $this->order->add($data);

        if (empty($data['order_id'])) {
            return $this->getResultError();
        }

        $order = $this->order->get($data['order_id']);
        $this->setBundledProducts($order, $data);

        if (empty($options['admin'])) {
            $this->setPriceRules($order);
            $this->updateCart($order, $data['cart']);
            $this->notifyCreated($order);
            $result = $this->getResultAdded($order);
        } else {
            $this->cloneCart($order, $data['cart']);
            $result = $this->getResultAddedAdmin($order);
        }

        $this->hook->attach('order.submit.after', $data, $options, $result, $this);
        return (array) $result;
    }
813523
public function add(array $data)
    {
        $result = array();
        $this->hook->attach('wishlist.add.product.before', $data, $result, $this);

        if (!empty($result)) {
            return (array) $result;
        }

        if ($this->wishlist->exists($data)) {
            return $this->getResultErrorExists($data);
        }

        if ($this->wishlist->exceedsLimit($data['user_id'], $data['store_id'])) {
            return $this->getResultErrorExceeds($data);
        }

        $data['wishlist_id'] = $this->wishlist->add($data);

        if (empty($data['wishlist_id'])) {
            return $this->getResultError();
        }

        $result = $this->getResultAdded($data);
        $this->hook->attach('wishlist.add.product.after', $data, $result, $this);
        return (array) $result;
    }
562328
public function addProduct(array $data)
    {
        $url = "https://api.weixin.qq.com/scan/product/create?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
139619
public function add_data(array $data)
	{
		$ar = \func_get_args();
		foreach ( $ar as $d ){
			if ( \is_array($d) ){
				$this->data = $this->has_data() ? array_merge($this->data,$d) : $d;
			}
		}
		return $this;
	}
262340
public function store(array $data)
    {
        $upload = $this->client->post(
            sprintf('buckets/%d/vaults/%d/uploads.json', $this->bucket, $this->parent),
            [
                'json' => $data,
            ]
        );

        return new Upload($this->response($upload));
    }
566555
public function payload(array $data)
    {
        foreach ($data as $key => $value) {
            $this->data->{$key} = $value;
        }

        return $this;
    }