Bonjour,
J'ai mis en place le schéma suivant :
Code :
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 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 204 205 206 207 208 209 210 211 212 213 214 215 216 217 218 219 220 221 222 223 224 225 226 227 228 229 230 231 232 233 234 235 236 237 238 239 240 241 242 243 244 245 246 247 248 249 250 251 252 253 254 255 256 257 258 259 260 261 262 263 264 265 266 267 268 269 270 271 272 273 274 275 276 277 278 279 280 281 282 283 284 285 286 287 288 289 290 291 292 293 294 295 296 297 298 299 300 301 302 303 304 305 306 307 308 309 310 311 312 313 314 315 316 317 318 319 320 321 322 323 324 325 326 327 328 329 330 331 332 333
|
Product:
connection: doctrine
tableName: product
actAs:
I18n:
fields: [name, description]
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
internal_reference:
type: string(30)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
internal_reference_archive:
type: string(30)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
supplier_reference:
type: string(30)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
name:
type: string(255)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
supplier_name:
type: string(255)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
description:
type: string()
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
commercial_message:
type: string()
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
commercial_argument:
type: string()
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
material:
type: string(100)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
size:
type: string(100)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
packaging:
type: string(100)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
duty:
type: string(20)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
duty_rate:
type: decimal(18,5)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
moq:
type: string(20)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
subcategory_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
supplier_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
news_at:
type: timestamp
format: Y-m-d H:i:s
fixed: false
unsigned: false
primary: false
notnull: true
relations:
ProductDetails:
local: id
foreign: product_id
type: many
ProductDetails:
connection: doctrine
tableName: product_details
actAs:
Timestampable: ~
Signable: ~
SoftDelete: ~
Versionable:
versionColumn: version
className: %CLASS%Version
auditLog: true
I18n:
fields: [name_suffix]
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
declination:
type: boolean
fixed: false
unsigned: false
primary: false
default: 0
notnull: true
autoincrement: false
internal_reference_suffix:
type: string(10)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
supplier_reference_suffix:
type: string(20)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
supplier_designation_suffix:
type: string(20)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
name_suffix:
type: string(20)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
gross_weight:
type: decimal(18,5)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
net_weight:
type: decimal(18,5)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
number_per_box:
type: integer(4)
fixed: false
unsigned: false
primary: false
default: '0'
notnull: true
autoincrement: false
volume:
type: decimal(18,5)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
procure_price:
type: decimal(18,5)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
print_inventory:
type: boolean
fixed: false
unsigned: false
primary: false
default: 0
notnull: true
autoincrement: false
inventory:
type: integer(8)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
inventory_value:
type: decimal(18,5)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
lead_times:
type: string(100)
fixed: false
unsigned: false
primary: false
notnull: false
autoincrement: false
is_active:
type: boolean
fixed: false
unsigned: false
primary: false
default: 1
notnull: true
autoincrement: false
product_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
Product:
local: product_id
foreign: id
type: one
ProductNomenclature:
local: id
foreign: product_id
type: many
ProductNomenclature2:
class: ProductNomenclature
local: id
foreign: product_id_nomenclature
type: many
ProductNomenclature:
connection: doctrine
tableName: product_nomenclature
options:
symfony:
filter: false
columns:
id:
type: integer(4)
fixed: false
unsigned: false
primary: true
autoincrement: true
quantity:
type: integer(4)
fixed: false
unsigned: false
primary: false
default: '0'
notnull: true
autoincrement: false
product_id:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
product_id_nomenclature:
type: integer(4)
fixed: false
unsigned: false
primary: false
notnull: true
autoincrement: false
relations:
ProductDetails:
local: product_id
foreign: id
type: one
ProductDetails2:
class: ProductDetails
local: product_id_nomenclature
foreign: id
type: one |
Un produit (product) peut avoir plusieurs enregistrements dans la table productDetails. Je souhaite pouvoir lier ces détails entre eux. J'ai donc mis en place une table productNomeclature qui stocke l'id 1 de productDetails et l'id 2 de productDetails + une quantité.
Si je liste les nomenclatures que je rentre en fixtures, tout fonctionne correctement, j'arrive à afficher les informations de productdetails liées à l'id 1 et l'id 2.
Par contre, je souhaite afficher mon formulaire productNomenclatureForm et j'ai l'erreur suivante :
Code :
1 2
|
SQLSTATE[42S22]: Column not found: 1054 Unknown column 'p.name_suffix' in 'field list'. Failing Query: "SELECT p.id AS p__id, p.declination AS p__declination, p.internal_reference_suffix AS p__internal_reference_suffix, p.supplier_reference_suffix AS p__supplier_reference_suffix, p.supplier_designation_suffix AS p__supplier_designation_suffix, p.name_suffix AS p__name_suffix, p.gross_weight AS p__gross_weight, p.net_weight AS p__net_weight, p.number_per_box AS p__number_per_box, p.volume AS p__volume, p.procure_price AS p__procure_price, p.print_inventory AS p__print_inventory, p.inventory AS p__inventory, p.inventory_value AS p__inventory_value, p.lead_times AS p__lead_times, p.is_active AS p__is_active, p.product_id AS p__product_id, p.created_at AS p__created_at, p.updated_at AS p__updated_at, p.created_by AS p__created_by, p.updated_by AS p__updated_by, p.deleted_at AS p__deleted_at, p.version AS p__version FROM product_details p WHERE (p.deleted_at IS NULL)" |
Le champ name_suffix n'est pas trouvé,c'est celui qui est traduit, c'est donc logique. J'ai l'impression que la relation Translation de ma table productDetails a sauté au niveau de mes relations étrangères, j'ai retourné le schéma dans tous les sens, fait pas mal de tests par rapport à ce que j'ai trouvé sur le web, mais rien.
Si vous avez une idée, je suis preneur !!
D'avance merci