# |
Jun 14th 2018, 09:51 |
tim |
Oh the Marshaller still retrieves those entities when using _ids so it's probably easier to just manually retrieve the entities in my controller |
# |
Jun 14th 2018, 09:48 |
tim |
Does that work in conjunction with _joinData? |
# |
Jun 14th 2018, 09:47 |
lorenzo |
there is also the `_ids` magic field when patching an entity, it will fetch the ids of those associations and calculate the ones that need saving |
# |
Jun 14th 2018, 09:46 |
tim |
Yeah It's BTM |
# |
Jun 14th 2018, 09:46 |
lorenzo |
you would have to use an update statamete for other relationships |
# |
Jun 14th 2018, 09:46 |
lorenzo |
well, in the case of a belongsToMany |
# |
Jun 14th 2018, 09:45 |
lorenzo |
@tim you can use an insert statement |
# |
Jun 14th 2018, 09:44 |
neon1024 |
Don’t forget that the TableRegistry is deprecated. |
# |
Jun 14th 2018, 09:39 |
tim |
Is there a way to save associations with `link()` using only the entity IDs rather than the entities themselves? |
# |
Jun 14th 2018, 09:16 |
javier_rodri1989 |
things |
# |
Jun 14th 2018, 09:16 |
javier_rodri1989 |
is other thinks |
# |
Jun 14th 2018, 09:15 |
roel |
I'm not sure actually, trying to figure out what's the best way of building my code, so it's easy to maintain and upgrade in the future |
# |
Jun 14th 2018, 09:13 |
lorenzo |
? |
# |
Jun 14th 2018, 09:13 |
lorenzo |
why do you use `TableRegistry` in the table? can’t you use associations |
# |
Jun 14th 2018, 09:13 |
roel |
oh :P |
# |
Jun 14th 2018, 09:13 |
lorenzo |
there is no such rule hehe |
# |
Jun 14th 2018, 09:12 |
roel |
Is there a reason why I should use `loadModel()` in the controller and `TableRegistry` in a model/table? since `TableRegistry` also works in the controllers. :P |
# |
Jun 14th 2018, 08:57 |
Martin` |
I'm working on a api to check barcodes, but every barcode can be used 1 time a day, but what exception do I throw when barcode is already used? :P |
# |
Jun 14th 2018, 08:56 |
roel |
Thanks :+1: |
# |
Jun 14th 2018, 08:55 |
tim |
Yup in models and tables you use TableRegistry |
# |
Jun 14th 2018, 08:55 |
roel |
And I want to load another table with a table i have to use the `TableRegistry::get();` right? :slightly_smiling_face: |
# |
Jun 14th 2018, 08:54 |
tim |
Use loadModel |
# |
Jun 14th 2018, 08:54 |
roel |
Hello everyone :slightly_smiling_face:, If I want to load another table within a controller do I use `$this->loadModel();` or `TableRegistry::get();` |
# |
Jun 14th 2018, 08:52 |
tim |
Show us some code? |
# |
Jun 14th 2018, 08:52 |
javier_rodri1989 |
The problem is the getter |
# |
Jun 14th 2018, 08:51 |
tim |
What are you using to save it to the entity? |
# |
Jun 14th 2018, 08:50 |
javier_rodri1989 |
I have a problem, I am adding data with a form, I have getter in the entity and it tells me that value string cannot convert it. So I don't getter them but of course.... getter is for reading and I would be writing when I send them. Thank you |
# |
Jun 14th 2018, 08:46 |
josbeir |
:rolling_on_the_floor_laughing: |
# |
Jun 14th 2018, 08:46 |
neon1024 |
@josbeir Can help you :P |
# |
Jun 14th 2018, 08:46 |
neon1024 |
@javier_rodri1989 What’s the question? |
# |
Jun 14th 2018, 08:45 |
neon1024 |
It’s not impolite. It’s impossible to guarantee help if you don’t know what the issue is ;) |
# |
Jun 14th 2018, 08:44 |
slackebot |
!ask |
# |
Jun 14th 2018, 08:44 |
slackebot |
Command sent from Slack by neon1024: |
# |
Jun 14th 2018, 08:35 |
tim |
I'm just saying :P |
# |
Jun 14th 2018, 08:34 |
josbeir |
now now @tim the man is polite! :slightly_smiling_face: |
# |
Jun 14th 2018, 08:34 |
tim |
Just ask, dont ask to ask |
# |
Jun 14th 2018, 08:22 |
javier_rodri1989 |
You can help me with a problem? |
# |
Jun 14th 2018, 08:21 |
javier_rodri1989 |
hello |
# |
Jun 14th 2018, 08:20 |
neon1024 |
@itamer I’ve never seen that method in the request object |
# |
Jun 14th 2018, 08:19 |
neon1024 |
@tylergel Set a specific selector on the HTML you want to style, probably a unique id attribute. |
# |
Jun 14th 2018, 08:01 |
narendravaghela |
:thumbsup: |