Log message #4182634

# At Username Text
# Apr 9th 2019, 07:58 admad Form->hidden() would just generate the input tag nothing else, so you actually went in the opposite direction to achieve want you want
# Apr 9th 2019, 07:58 conehead @admad ah thanks. already tried that. Had to change from Form->hidden to Form->control to get it to work
# Apr 9th 2019, 07:58 admad @conehead use the 'template' key in options to override required template(s)
# Apr 9th 2019, 07:58 admad cast your votes guys https://github.com/cakephp/cakephp/issues/13103 :slightly_smiling_face:
# Apr 9th 2019, 07:43 conehead is it possible to disable a form template for a single field? I get several divs around an hidden field :S
# Apr 9th 2019, 07:24 spriz that’s a good #dislacimer
# Apr 9th 2019, 07:24 spriz :,)
# Apr 9th 2019, 07:24 neon1024 I will qualify it that I’ve just arrived at work and haven’t had a coffee yet! :P
# Apr 9th 2019, 07:24 spriz Yeah, I think I will :slightly_smiling_face:
# Apr 9th 2019, 07:24 spriz I’ll explore youre idea and check pros and cons though
# Apr 9th 2019, 07:24 neon1024 Give it a go in a branch perhaps and bake some stuff, see how you like it
# Apr 9th 2019, 07:23 spriz Just `Products BelongsToMany Products through RelatedProducts` - same same though
# Apr 9th 2019, 07:23 spriz That was my original idea
# Apr 9th 2019, 07:23 neon1024 ..and the store the association type in the join table? :man-shrugging:
# Apr 9th 2019, 07:23 neon1024 Perhaps Products hasAndBelongsToMany Products Through AssociatedProducts
# Apr 9th 2019, 07:22 neon1024 Or maybe I’m wrong. Perhaps you just want a hasAndBelongsToMany Through
# Apr 9th 2019, 07:22 neon1024 Perhaps I explained it badly! :P
# Apr 9th 2019, 07:22 neon1024 That’s the many-to-many part, so you can have the products to choose from :slightly_smiling_face:
# Apr 9th 2019, 07:21 spriz thanks though!
# Apr 9th 2019, 07:21 spriz I have to draw it to understand I think :P
# Apr 9th 2019, 07:21 neon1024 They would be
# Apr 9th 2019, 07:21 neon1024 That would be my approach anyway :slightly_smiling_face:
# Apr 9th 2019, 07:21 spriz but those AssociatedProduct need to be other `Product`entities
# Apr 9th 2019, 07:21 neon1024 Then you could customise the property name depending on the AssociatedProductTypes.name
# Apr 9th 2019, 07:21 neon1024 So then I’d have a product, and a nice ’associated_products` entity property with an array of products
# Apr 9th 2019, 07:20 neon1024 `$this->Products->find()->contain(['AssociatedProducts' => function (Query $q) { return $q->where(['AssociatedProducts.association_type_id' => 1]); } ]);`
# Apr 9th 2019, 07:20 spriz Ah I see
# Apr 9th 2019, 07:19 neon1024 Product hasMany AssociatedProduct
# Apr 9th 2019, 07:19 neon1024 AssociatedProduct belongsTo Product
# Apr 9th 2019, 07:19 neon1024 Many rows
# Apr 9th 2019, 07:19 neon1024 As the association would be to the product
# Apr 9th 2019, 07:19 spriz then how would that link 2 products :thinking_face: ?
# Apr 9th 2019, 07:18 neon1024 It would only have product_id
# Apr 9th 2019, 07:18 neon1024 It would not, no.
# Apr 9th 2019, 07:18 neon1024 Then I could get any product, and get all it’s associations by type
# Apr 9th 2019, 07:18 spriz but it would still contain `product_source_id` and `product_target_id` I guess?
# Apr 9th 2019, 07:18 neon1024 So I could have a table with all the associations
# Apr 9th 2019, 07:18 neon1024 Probably with a ‘many-to-many’ join
# Apr 9th 2019, 07:18 neon1024 Then my UI would be a multi select of products for each type
# Apr 9th 2019, 07:17 neon1024 @spriz I’d have another table for ‘product_associations’, with id, product_id, association_type_id
# Apr 9th 2019, 07:15 spriz @conehead sounds like beforeMarshal :slightly_smiling_face: