Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

1295 add array as type in DataModel properties #2488

Conversation

SilinMykola
Copy link
Contributor

Description (*)
This PR adds an array as a type in DataModel properties
1295-add-array-to-datamodel-properties

Fixed Issues (if relevant)

  1. Fixes Please add array as type in DataModel properties #1295

Questions or comments

Contribution checklist (*)

  • Pull request has a meaningful description of its purpose
  • All commits are accompanied by meaningful commit messages
  • All new or changed code is covered with integration/functional tests (if applicable)
  • All automated tests passed successfully (all builds are green)

Copy link
Contributor

@VitaliyBoyko VitaliyBoyko left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This cast is unnecessary for the array, see how it works for the type string

/**
* Getter for Foo.
*
* @return array|null
*/
public function getFoo(): ?array
{
return $this->getData(self::FOO) === null ? null
: (array)$this->getData(self::FOO);
}

also please update the Changelog.md with the changes

@SilinMykola
Copy link
Contributor Author

@VitaliyBoyko I made changes. Please check.
Thank you!

@VitaliyBoyko VitaliyBoyko merged commit 10d6165 into magento:5.4.0-develop Feb 16, 2025
5 checks passed
@SilinMykola SilinMykola deleted the 1295-add-array-to-datamodel-properties branch February 17, 2025 15:13
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
Development

Successfully merging this pull request may close these issues.

Please add array as type in DataModel properties
3 participants