Skip to content

Commit

Permalink
Merge pull request #24 from amocrm/hotfix/cf_empty_val
Browse files Browse the repository at this point in the history
fix cf code
  • Loading branch information
bessudnov authored Jun 16, 2020
2 parents e16c958 + 880ce25 commit d6eb2ce
Showing 1 changed file with 1 addition and 2 deletions.
3 changes: 1 addition & 2 deletions src/AmoCRM/Models/CustomFields/CustomFieldModel.php
Original file line number Diff line number Diff line change
Expand Up @@ -157,7 +157,7 @@ public static function fromArray(array $customField): CustomFieldModel
->setId($customField['id'])
->setName($customField['name'])
->setSort($customField['sort'])
->setCode($customField['code'])
->setCode(empty($customField['code']) ? null : $customField['code'])
->setEntityType($customField['entity_type'])
->setAccountId($customField['account_id']);

Expand All @@ -171,7 +171,6 @@ public static function fromArray(array $customField): CustomFieldModel
);
}


if (array_key_exists('is_api_only', $customField)) {
$customFieldModel->setIsApiOnly($customField['is_api_only']);
}
Expand Down

0 comments on commit d6eb2ce

Please sign in to comment.