Jump to:

5521 Posts in 1734 Topics by 1223 members

Customising the CMS

SilverStripe Forums » Customising the CMS » Setting required fields for DataObjectDecorator

Moderators: martimiz, Sean, biapar, Willr, Ingo, swaiba, simon_w

Page: 1
Go to End
Author Topic: 455 Views
  • tgfisher
    Avatar
    Community Member
    10 Posts

    Setting required fields for DataObjectDecorator Link to this post

    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.

  • tgfisher
    Avatar
    Community Member
    10 Posts

    Re: Setting required fields for DataObjectDecorator Link to this post

    Anyone?

    455 Views
Page: 1
Go to Top

Want to know more about the company that brought you SilverStripe? Then check out SilverStripe.com

Comments on this website? Please give feedback.