Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/master'
Browse files Browse the repository at this point in the history
  • Loading branch information
bessudnov committed Mar 25, 2024
2 parents dd1b6ea + 010247c commit ea4bc87
Show file tree
Hide file tree
Showing 3 changed files with 23 additions and 2 deletions.
4 changes: 4 additions & 0 deletions src/AmoCRM/EntitiesServices/CatalogElements.php
Original file line number Diff line number Diff line change
Expand Up @@ -154,6 +154,10 @@ protected function processModelAction(BaseApiModel $apiModel, array $entity): vo
if (isset($entity['catalog_id'])) {
$apiModel->setCatalogId($entity['catalog_id']);
}

if (isset($entity['invoice_link'])) {
$apiModel->setInvoiceLink($entity['invoice_link']);
}
}


Expand Down
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 ea4bc87

Please sign in to comment.