Skip to content

Feature request. Small but useful. Entity class. #1176

Description

@nowackipawel

There is an feature which allows to cast value of attribute of entity.
Could someone add another options to switch in Entity::castAs($value, string $type)
i.e. like this:

			case 'json-array':
				if (is_string($value) && (strpos($value, '[') === 0 || strpos($value, '{') === 0))
				{
					$value = json_decode($value, true);
				}
				break;
			case 'json-object':
				if (is_string($value) && (strpos($value, '[') === 0 || strpos($value, '{') === 0))
				{
					$value = json_decode($value, false);
				}
				break;

imho it will be useful.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions