public function customersEdit(array $customer, $by = 'externalId', $site = null)
    {
        if (!count($customer)) {
            throw new \InvalidArgumentException(
                'Parameter `customer` must contains a data'
            );
        }

        $this->checkIdParameter($by);

        if (!array_key_exists($by, $customer)) {
            throw new \InvalidArgumentException(
                sprintf('Customer array must contain the "%s" parameter.', $by)
            );
        }

        /* @noinspection PhpUndefinedMethodInspection */
        return $this->client->makeRequest(
            sprintf('/customers/%s/edit', $customer[$by]),
            "POST",
            $this->fillSite(
                $site,
                ['customer' => json_encode($customer), 'by' => $by]
            )
        );
    }
public function customersEdit(array $customer, $by = 'externalId', $site = null)
    {
        if (!count($customer)) {
            throw new \InvalidArgumentException(
                'Parameter `customer` must contains a data'
            );
        }

        $this->checkIdParameter($by);

        if (!array_key_exists($by, $customer)) {
            throw new \InvalidArgumentException(
                sprintf('Customer array must contain the "%s" parameter.', $by)
            );
        }

        /* @noinspection PhpUndefinedMethodInspection */
        return $this->client->makeRequest(
            sprintf('/customers/%s/edit', $customer[$by]),
            "POST",
            $this->fillSite(
                $site,
                ['customer' => json_encode($customer), 'by' => $by]
            )
        );
    }
public function customersEdit ( array $ customer , $ by = 'externalId' , $ site = null ) { if ( ! count ( $ customer ) ) { throw new \ InvalidArgumentException ( 'Parameter `customer` must contains a data' ) ; } $ this -> checkIdParameter ( $ by ) ; if ( ! array_key_exists ( $ by , $ customer ) ) { throw new \ InvalidArgumentException ( sprintf ( 'Customer array must contain the "%s" parameter.' , $ by ) ) ; } /* @noinspection PhpUndefinedMethodInspection */ return $ this -> client -> makeRequest ( sprintf ( '/customers/%s/edit' , $ customer [ $ by ] ) , "POST" , $ this -> fillSite ( $ site , [ 'customer' => json_encode ( $ customer ) , 'by' => $ by ] ) ) ; }
Edit a customer

@param array  $customer customer data
@param string $by       (default: 'externalId')
@param string $site     (default: null)

@throws \InvalidArgumentException
@throws \RetailCrm\Exception\CurlException
@throws \RetailCrm\Exception\InvalidJsonException

@return \RetailCrm\Response\ApiResponse
Edit a customer