diff --git a/src/classes/crm/quote/quote.php b/src/classes/crm/quote/quote.php new file mode 100644 index 00000000..2cdaa682 --- /dev/null +++ b/src/classes/crm/quote/quote.php @@ -0,0 +1,106 @@ +client->call( + 'crm.quote.list', + array( + 'order' => $order, + 'filter'=> $filter, + 'select'=> $select, + 'start' => $start + ) + ); + return $fullResult; + } + + /** + * get quote by id + * @var $quoteId integer quote identifier + * @link http://dev.1c-bitrix.ru/rest_help/crm/quote/crm_quote_get.php + * @return array + */ + public function get($quoteId) + { + $fullResult = $this->client->call( + 'crm.quote.get', + array('id' => $quoteId) + ); + return $fullResult; + } + + /** + * delete quote by id + * @var $quoteId integer quote identifier + * @link http://dev.1c-bitrix.ru/rest_help/crm/quote/crm_quote_delete.php + * @return array + */ + public function delete($quoteId) + { + $fullResult = $this->client->call( + 'crm.quote.delete', + array('id' => $quoteId) + ); + return $fullResult; + } + + /** + * Add a new quote to CRM + * @param array $fields array of fields + * @link http://dev.1c-bitrix.ru/rest_help/crm/quote/crm_quote_add.php + * @return array + */ + public function add($fields = array()) + { + $fullResult = $this->client->call( + 'crm.quote.add', + array('fields' => $fields) + ); + return $fullResult; + } + + /** + * update quote by id + * @var $quoteId integer quote identifier + * @var $quoteFields array quote fields to update + * @link http://dev.1c-bitrix.ru/rest_help/crm/quote/crm_quote_update.php + * @return array + */ + public function update($quoteId, $quoteFields) + { + $fullResult = $this->client->call( + 'crm.quote.update', + array( + 'id' => $quoteId, + 'fields' => $quoteFields + ) + ); + return $fullResult; + } + + /** + * get list of quote fields with description + * @link http://dev.1c-bitrix.ru/rest_help/crm/quote/crm_quote_fields.php + * @return array + */ + public function fields() + { + $fullResult = $this->client->call( + 'crm.quote.fields' + ); + return $fullResult; + } +}