1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66
| Category:
actAs:
Timestampable: ~
Sluggable:
fields: [name]
unique: true
NestedSet:
hasManyRoots: true
rootColumnName: root_id
columns:
name: { type: string(80), notnull: true }
active: { type: boolean }
relations:
Categories: { class: Category, local: id, foreign: root_id }
Produit:
actAs:
DmSortable:
I18n:
fields: [ ref,name,stocks,indices, contents, is_active ]
Timestampable: ~
Sluggable:
fields: [name]
unique: true
Searchable:
fields: [name, code]
columns:
tarifsdegresif_id: { type: integer }
tva_id: { type: integer }
tarif: { type: string(100), notnull : true }
ref: { type: string(155), notnull: false }
quantity: { type: integer, notnull: false }
name: { type: string(100), notnull: true }
contents: { type: clob, extra: markdown }
author: { type: integer, notnull: true }
is_active: { type: boolean, notnull: true, default: false }
image: { type: integer }
stocks: { type: boolean, notnull: false , default: 1 }
relations:
Image:
class: DmMedia
local: image
foreignAlias: Produits
Author:
class: DmUser
local: author
foreignAlias: Produits
Tva: { onDelete: CASCADE, local: tva_id, foreign: id, foreignAlias: Produits }
Categories: { class: Category, local: produit_id, foreign: category_id, refClass: ProduitCategory, foreignAlias: Produits }
ProduitCategory:
options:
actAs: [Timestampable]
columns:
produit_id: { type: integer, primary: true }
category_id: { type: integer, primary: true }
relations:
Produit: { class: Produit, local: produit_id, foreign: id, onDelete: CASCADE }
Category: { class: Category, local: category_id, foreign: id, onDelete: CASCADE }
Tva:
actAs:
Timestampable:
DmVersionable:
columns:
indices: { type: string(10), notnull: true } |
Partager