Adds a product class
@param array $data
@return integer
519605
public function add(array $data)
    {
        $result = null;
        $this->hook->attach('product.class.add.before', $data, $result, $this);

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

        $result = $this->db->insert('product_class', $data);
        $this->hook->attach('product.class.add.after', $data, $result, $this);
        return (int) $result;
    }
893649
public function add(array $data)
    {
        $result = null;
        $this->hook->attach('module.backup.add.before', $data, $result, $this);

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

        $version = null;
        if (isset($data['version'])) {
            $version = $data['version'];
        }

        if ($this->exists($data['id'], $version)) {
            return false;
        }

        if (empty($data['user_id'])) {
            $data['user_id'] = $this->user->getId();
        }

        $data['created'] = GC_TIME;
        $result = $this->db->insert('backup', $data);

        $this->hook->attach('module.backup.add.after', $data, $result, $this);
        return $result;
    }
686572
public function addDeviceGroup(array $data)
    {
        $url = "https://api.weixin.qq.com/shakearound/device/group/adddevice?access_token=ACCESS_TOKEN";
        $this->registerApi($url, __FUNCTION__, func_get_args());
        return $this->httpPostForJson($url, $data);
    }
444742
public function addItems($data)
	{
		if( is_null($data) )
		{
			return;
		}

		if( $data instanceof stdClass )
		{
			$data = [$data];
		}

		if( is_array($data) )
		{
			$data = $this->checkItems($data);
			$this->data = array_merge($this->data, $data);
		}
	}
1303963
public function add(array $data)
    {
        $data = $this->resolverFactory->createNewDeviceResolver()->resolve($data);

        return $this->api->request('POST', '/players', [], json_encode($data));
    }
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);
    }
1026583
private function addEdgesFromArray(array $data)
    {
        $_edgeClass = $this->_edgeClass;

        $this->_result[] = $_edgeClass::createFromArray($data, $this->_options);
    }
1096111
public function addShelf(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_SHELF_ADD_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success' ? $result['shelf_id'] : false;
    }
869192
public function addMetadata($data)
    {
        if (is_array($data)) {
            foreach ($data as $k => $v) {
                $this->metadata[$k] = $v;
            }
        }
        else {
            $this->metadata[] = $data;
        }

        return $this;
    }
797345
private function addVerticesFromArray(array $data)
    {
        $_documentClass = $this->_documentClass;

        $this->_result[] = $_documentClass::createFromArray($data, $this->_options);
    }
546122
static public function add($data)
    {
        try {
            $model = new static;
            $attributes = array_flip($model->attributes);
            $data = array_filter($data, function ($data) use ($attributes) {
                return isset($attributes[$data]);
            }, ARRAY_FILTER_USE_KEY);
            $sql = 'INSERT INTO '.$model->table.' (';
            foreach ($data as $column => $value) {
                $sql .= '`'.$column.'`, ';
            }
            $sql = trim($sql, ', ');
            $sql .= ') VALUES (';
            foreach ($data as $column => $value) {
                $sql .= ':'.$column.', ';
            }
            $sql = trim($sql, ', ');
            $sql .= ')';
            $statement = $model->connect->prepare($sql);
            foreach ($data as $column => $value) {
                $statement->bindValue(':'.$column, $value);
            }
            try {
                $statement->execute();
                return $model->connect->lastInsertId();
            } catch(\PDOExecption $e) {
                $model->connect->rollback();
                return "Error" . $e->getMessage();
            }
        } catch( \PDOExecption $e ) {
            return "Error" . $e->getMessage();
        }
    }
830516
public function add(array $product, array $data)
    {
        $result = array();
        $this->hook->attach('cart.add.product.before', $product, $data, $result, $this);

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

        $data += array(
            'quantity' => 1,
            'user_id' => $this->cart->getUid(),
            'store_id' => $product['store_id'],
            'product_id' => $product['product_id']
        );

        $data['cart_id'] = $this->set($data);

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

        $result = $this->getResultAdded($data);
        $this->hook->attach('cart.add.product.after', $product, $data, $result, $this);
        return (array) $result;
    }
1330528
public function addGroups($data){

        foreach ($data as $k=>$v){
            $groups[] = ['name' => $k , 'title' => $v];
        }
        $this->formGroups = $groups;
        return $this;
    }
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;
    }
865927
public function add(array $data): Insert
    {
        if (!isset($data[0]) && count($this->fields) == 0) {
            $this->fields(array_keys($data));
        }

        $this->data[] = $data;
        return $this;
    }
1171696
public function add(array $data)
    {
        $result = null;
        $this->hook->attach('image.style.add.before', $data, $result, $this);

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

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

        $imagestyle_id = count($this->getList()) + 1;
        $imagestyles = $this->config->get('imagestyles', array());

        $imagestyles[$imagestyle_id] = array_intersect_key($data, $default);
        $this->config->set('imagestyles', $imagestyles);

        $this->hook->attach('image.style.add.after', $data, $imagestyle_id, $this);
        return (int) $imagestyle_id;
    }
26798
public function updateGroupProduct(array $data)
    {
        $result = $this->wechat->httpRaw(self::WECHAT_GROUP_PRODUCT_UPDATE_PREFIX, $data, [
            'access_token' => $this->wechat->getAccessToken()
        ]);
        return isset($result['errmsg']) && $result['errmsg'] == 'success';
    }