Love Fuel?    Donate

FuelPHP Forums

Ask your question about FuelPHP in the appropriate forum, or help others by answering their questions.
Nested Relation Unique
  • Hi, Say I have 2 models: Users,
    Services a User can have many services
    a Service can have many Users, However, I need to store extra info for the relation. So I created the User_Service model etc All is working fine creating the relationship However, I want to make sure each user can only be registered to a service once. At the minute, it just creates a new record. Is there a way to make "service" unique for a user?
  • Anyone? :( Basically, I have: service_users id, user id, service id, username 1 1 1 username
    1 1 1 username but it shouldnt allow it, however, 1 1 2 username would be acceptable. in Rails, you'd have: has_many :services, :uniq => true

Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

In this Discussion

  • Chad November 2011