Skip to content

Commit

Permalink
Merge branch 'feature/AC-828' into 'master'
Browse files Browse the repository at this point in the history
Account invoices settings invoices catalog id added

See merge request amocrm/amocrm-api-php!38
  • Loading branch information
Nikita committed Mar 12, 2024
2 parents c41a1ad + cffa864 commit bc4223d
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 2 deletions.
3 changes: 2 additions & 1 deletion src/AmoCRM/Models/AccountModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -454,7 +454,8 @@ public static function fromArray(array $account): self

if (isset($account[self::INVOICES_SETTINGS])) {
$accountModel->setInvoicesSettings(new InvoicesSettings(
$account[self::INVOICES_SETTINGS]['lang'] ?? null
$account[self::INVOICES_SETTINGS]['lang'] ?? null,
$account[self::INVOICES_SETTINGS]['invoices_catalog_id'] ?? null
));
}

Expand Down
18 changes: 17 additions & 1 deletion src/AmoCRM/Models/AccountSettings/InvoicesSettings.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,17 @@ class InvoicesSettings implements Arrayable
*/
protected $lang;

/**
* @var int|null
*/
protected $invoicesCatalogId;

public function __construct(
?string $lang
?string $lang,
?int $invoicesCatalogId
) {
$this->lang = $lang;
$this->invoicesCatalogId = $invoicesCatalogId;
}

/**
Expand All @@ -24,6 +31,7 @@ public function toArray(): array
{
return [
'lang' => $this->getLang(),
'invoices_catalog_id' => $this->getInvoicesCatalogId(),
];
}

Expand All @@ -34,4 +42,12 @@ public function getLang(): ?string
{
return $this->lang;
}

/**
* @return int|null
*/
public function getInvoicesCatalogId(): ?int
{
return $this->invoicesCatalogId;
}
}

0 comments on commit bc4223d

Please sign in to comment.