# |
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: |
# |
Apr 9th 2019, 06:50 |
conehead |
Oh. BeforeValidate does not exist anymore |
# |
Apr 9th 2019, 06:45 |
conehead |
What would be the best place to convert date strings to date objects before saving. In before validate? Before save? |
# |
Apr 8th 2019, 19:08 |
blackjccl |
please help |
# |
Apr 8th 2019, 19:08 |
blackjccl |
He called the class well ´$pdf = new TCPDF('L',PDF_UNIT,PDF_PAGE_FORMAT,TRUE,'UTF-8',FALSE);´ |
# |
Apr 8th 2019, 19:07 |
blackjccl |
I do not know if in my configuration I have to do something else |
# |
Apr 8th 2019, 19:06 |
blackjccl |
Hi community I'm using plugin CakePdf with the library tcpdf and when generating the pdf it shows me the following error |
# |
Apr 8th 2019, 16:41 |
spriz |
But yes - indeed many products can be “alternatives”, “related”, “similar” etc (type) to many other products :) |
# |
Apr 8th 2019, 16:40 |
spriz |
I’m not saying I don’t agree - but I need more explanation :D |
# |
Apr 8th 2019, 16:40 |
spriz |
@neon1024 what would the benefit in your opinion? It would have still have 2 different product_id columns and some type and source |
# |
Apr 8th 2019, 16:14 |
rogerpro |
Thanks @rochasmarcelo. The field is in an association. I will try that in a while. |
# |
Apr 8th 2019, 16:10 |
rochasmarcelo |
@rogerpro I think you could add a virtual field for it and add to allowed search fields |
# |
Apr 8th 2019, 15:48 |
neon1024 |
I would guess that @spriz use-case is probably more complex |
# |
Apr 8th 2019, 15:48 |
neon1024 |
Which would be `product_variants` or similar. Like I said, normalize into association |
# |
Apr 8th 2019, 15:48 |
rogerpro |
I guess he needs many alternatives for each product |
# |
Apr 8th 2019, 15:39 |
neon1024 |
Or normalizing the differences to an association? |
# |
Apr 8th 2019, 15:38 |
neon1024 |
@spriz Why not a self-referencing table? |
# |
Apr 8th 2019, 15:36 |
neon1024 |
I want to see if the string appears twice |
# |
Apr 8th 2019, 15:35 |
neon1024 |
Anyone know if there is a method of like `assertResponseContains($string, $numberOfInstances)` |
# |
Apr 8th 2019, 15:35 |
neon1024 |
So the test suite provides `assertResponseContains` |
# |
Apr 8th 2019, 15:03 |
rogerpro |
It makes sense, @spriz |
# |
Apr 8th 2019, 14:59 |
spriz |
I realise I need different aliases for the properties, but that’s no problemo :slightly_smiling_face: |
# |
Apr 8th 2019, 14:58 |
spriz |
I need to start marking “Products” as alternatives to other Products - and the obvious thing imo is a `products_products` `BelongsToMany` assoc with a source and a target fk - am I on the road to something really stupid? |
# |
Apr 8th 2019, 14:51 |
devito |
cross db joining a thing in cake 3? |
# |
Apr 8th 2019, 14:48 |
rogerpro |
How to allow the user to sort by a calculated MAX() field with pagination in Cake 2? |
# |
Apr 8th 2019, 13:28 |
Nitrogen |
actually, HAVING worked just fine. |
# |
Apr 8th 2019, 12:55 |
asdfgh |
why Time::parse('now') returns 4/8/19, 12:54 PM i need this format 'Y-m-d H:i:s' (for db) |