Jump to:

17452 Posts in 4473 Topics by 1971 members

Archive

SilverStripe Forums » Archive » Muiltiple Member types and relations

Our old forums are still available as a read-only archive.

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

Page: 1
Go to End
Author Topic: 1364 Views
  • zalzadore
    Avatar
    Community Member
    20 Posts

    Muiltiple Member types and relations Link to this post

    Hi,
    I have a data model requiring 3 different types of Members (with log ins and different extra fields) that have 1-many relationships with 3 different tables:

    Student --* requirement
    Provider --* offer
    Organisation --* client

    I am trying to work out the following:

    1. Should I extend Member with a DataObjectDecorator with appropriate added fields and then disable/modify output according to an added 'type' field in the Member table? If so, how would I represent the 3 different table relationships? Would having 3 objects in the has_many array create problems when only one of them will be populated per Member?

    2. Should I extend Member with 3 different DataObjectDecorators?

    3. Am I better off maintaining 1-1 relationships between Member and 3 new tables that hold the extra fields and are then represented by 3 new objects - Student, Provider, Organisation

    4. Is there a better way?

    Ta,
    Z.

  • zalzadore
    Avatar
    Community Member
    20 Posts

    Re: Muiltiple Member types and relations Link to this post

    Anyone?

  • Hamish
    Avatar
    Community Member
    712 Posts

    Re: Muiltiple Member types and relations Link to this post

    I'd go option 1 - seems the simplest and I don't see any problems only filling in one relationship. Option 2 is (effectively) going to be the same thing anyway.

    Option 3 is feasible - and potentially cleaner, but perhaps harder to maintain from the CMS.

  • zalzadore
    Avatar
    Community Member
    20 Posts

    Re: Muiltiple Member types and relations Link to this post

    Hmm...

    Thanks Hamish. That was my first thought, the problem is that there will be a lot of redundant fields for each of the members.

    E.g. (Summarising)
    Organisation(ID, OrgType, Name, Contact, Address, City, Postcode, Phone, Fax, Email)
    Student(ID, FirstName, LastName, Institution, GradYear, Modality, Practising, Email)
    Provider(ID, FirstName, LastName, Address, City, Postcode, Phone, Fax, Email)

    Adding new members through the CMS will be dodge if certain fields have to be ignored by the operator.

    Would it be possible to set up 3 new TABs on the Member screen? One for each user type with a TableListField containing only the relevant columns (and pre-populated rows) for that user type?

  • justjc51
    Avatar
    Community Member
    23 Posts

    Re: Muiltiple Member types and relations Link to this post

    I'm looking for something simular, so let's try this again, can anyone help with the above idea of making the members choose?

    1364 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.