Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Customising the CMS /

Setting required fields for DataObjectDecorator


Reply


2 Posts   507 Views

Avatar
tgfisher

Community Member, 10 Posts

27 October 2011 at 3:05am

Is it possible to define required fields using DataObjectDecorator? I am working on adding extra fields to the Member class, and from what I've read (and seen myself), extending Member is not a good idea.

Because of this, I have extended DataObjectDecorator and extended Member using my new class.

One of the fields that I've added will act as the "unique identifier field" for Member once it is extended by my class, and I need to: a) require it upon creating/editing a member, and b) ensure that the value entered is unique.

I've tried using the ForumRole class as a reference to accomplish this by creating my own Validator class and extending Member_Validator within _config.php, but it does not appear that I can define required fields using that approach.

Also something to note, I will be applying an Authenticator to this when I'm past this point to handle authentication.

Avatar
tgfisher

Community Member, 10 Posts

1 November 2011 at 1:27am

Anyone?