Skip to content

Instantly share code, notes, and snippets.

@dator-zz
Created January 9, 2012 13:58
Show Gist options
  • Save dator-zz/da6be3b29bb9acb3125e to your computer and use it in GitHub Desktop.
Save dator-zz/da6be3b29bb9acb3125e to your computer and use it in GitHub Desktop.
Category:
actAs:
Sluggable:
unique: true
fields: [name]
canUpdate: true
NestedSet:
hasManyRoots: true
rootColumnName: root_id
columns:
name: { type: string(255), notnull: true }
Offer:
actAs:
Timestampable: ~
Sluggable:
unique: true
fields: [name]
canUpdate: true
columns:
provider_id: { type: integer }
name: { type: string(255), notnull: true }
description: { type: string(500), notnull: true }
price: { type: float, notnull: true }}
picture: { type: string(255), notnull: true }
relations:
Provider: { class: sfGuardUser, local : provider_id, foreignType: one }
Categories: { foreignAlias: Offers, class: Category, refClass: OfferCategory }
OfferCategory:
columns:
category_id: { type: integer, primary: true }
offer_id: { type: integer, primary: true }
relations:
Category: { foreignAlias: OfferCategories }
Offer: { foreignAlias: OfferCategories }
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment