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

Single field object #29

Open
mabar opened this issue Oct 20, 2022 · 0 comments
Open

Single field object #29

mabar opened this issue Oct 20, 2022 · 0 comments

Comments

@mabar
Copy link
Member

mabar commented Oct 20, 2022

For value objects support - like email, url, phone number, credit card number.
Value objects may be whole different library, with object mapper being an optional feature.

  • instead of items key accepts only values of items (expects the value of field to be given directly, not in array of ['field' => 'value']
  • allows single mapped property
  • callbacks should still work the same
  • types should be modified for the different structure
    • but still allow field-independent errors?
  • FieldName modifier is forbidden
#[SingleFieldObject]
final class SingleFieldInput implements MappedObject
{

	#[ListOf(item: new MappedObjectValue(ItemInput::class))]
	public array $items;

}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Development

No branches or pull requests

1 participant