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

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

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

@param array  $cost cost data
@param string $site (default: null)

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

@return \RetailCrm\Response\ApiResponse
Edit a cost