# |
Mar 6th 2018, 11:47 |
slackebot |
also be null - throw exception of missing value. This will lead to hardfinding errors with json encoding entity - Make queries in method to get associated records to be used I was just wondering, should entities even be used like that, and if not, what would be preferred way? Should I create some wrapper classes around entities to provide such behavior? |
# |
Mar 6th 2018, 11:47 |
makallio85 |
I have question about how entities are meant to be used. I have entity that have virtual value that relies on associated table. I find it hard to find proper solution to provide correct return value if developer didnt contain associated table in query. I have been thinking following scenarios: - check existance of association in entity properties and return null if none found (value cannot be formed). This leads to problems if value can |
# |
Mar 6th 2018, 11:14 |
joshualuckers |
https://book.cakephp.org/3.0/en/views/helpers/form.html#control-specific-options |
# |
Mar 6th 2018, 11:12 |
turkles |
Hi.. I have a form where I need the user to fill in an id value (called player_id, which is used to associate with Player model). Now the ID is something that comes from a game, and I can only get it from the user.. how do I stop my form displaying a drop down box as if it had to come from associated model data? |
# |
Mar 6th 2018, 09:20 |
rudy1976s |
okay, I am in a class wichi is registered and implements events: I have an event called afterOrder which fires correctly and I need at the end of the callable to be able to fire and event which is imlemented in the component: is this possibile ? |
# |
Mar 6th 2018, 08:55 |
saeideng |
https://book.cakephp.org/3.0/en/core-libraries/events.html#global-event-manager |
# |
Mar 6th 2018, 08:54 |
saeideng |
and |
# |
Mar 6th 2018, 08:54 |
saeideng |
https://book.cakephp.org/3.0/en/core-libraries/events.html#registering-listeners |
# |
Mar 6th 2018, 08:52 |
saeideng |
`EventManager::instance()->on(new \App\Event\Email());` for example |
# |
Mar 6th 2018, 08:50 |
rudy1976s |
please be patient , I know this could be a silly question :slightly_smiling_face: |
# |
Mar 6th 2018, 08:49 |
rudy1976s |
I have implemented a couple of events in the implemented events of a component: how can I register it ? I am a bit confused regarding events. The same events are registered in another class and they fired correctly while the component one does not |
# |
Mar 6th 2018, 08:35 |
rudy1976s |
Good morning |
# |
Mar 6th 2018, 08:07 |
iqu |
works |
# |
Mar 6th 2018, 08:07 |
iqu |
=> return $q->where(['Users.id !=' => $user_id]); |
# |
Mar 6th 2018, 07:54 |
iqu |
]); |
# |
Mar 6th 2018, 07:54 |
iqu |
}] |
# |
Mar 6th 2018, 07:54 |
iqu |
return $q->where(['users.id IS NOT' => $user_id]); |
# |
Mar 6th 2018, 07:54 |
iqu |
'contain' => ['Users' => function ($q) use ($user_id) { |
# |
Mar 6th 2018, 07:54 |
iqu |
$work = $this->Works->get($id, [ |
# |
Mar 6th 2018, 07:54 |
iqu |
mysqld works fine. MariaDB 12 gives error 1054 unknown column. |
# |
Mar 6th 2018, 06:32 |
savant |
2015 was a good vintage |
# |
Mar 6th 2018, 06:32 |
megan |
what year are you living in? :thinking_face: |
# |
Mar 6th 2018, 06:31 |
megan |
lol |
# |
Mar 6th 2018, 06:31 |
savant |
:) |
# |
Mar 6th 2018, 06:31 |
savant |
Close enough |
# |
Mar 6th 2018, 06:30 |
savant |
nice nice |
# |
Mar 6th 2018, 06:28 |
yadav.manu36 |
Thanks @savant now it is working. |
# |
Mar 6th 2018, 06:24 |
megan |
Morning everyone :slightly_smiling_face: |
# |
Mar 6th 2018, 04:57 |
ricksaccous |
oh, lol |
# |
Mar 6th 2018, 04:57 |
savant |
@ricksaccous just use `__()` |
# |
Mar 6th 2018, 04:57 |
ricksaccous |
for validation |
# |
Mar 6th 2018, 04:57 |
ricksaccous |
when you define the messages in the model |
# |
Mar 6th 2018, 04:56 |
savant |
@ricksaccous get what going |
# |
Mar 6th 2018, 04:56 |
ricksaccous |
like auto-translate? |
# |
Mar 6th 2018, 04:56 |
yadav.manu36 |
i am follow below url steps but still is,t working https://stackoverflow.com/questions/34426567/cakephp-3-paginator-sort-by-languages-with-i18n-translate-behavior |
# |
Mar 6th 2018, 04:56 |
ricksaccous |
is there a way to get that going with form error messages? |
# |
Mar 6th 2018, 04:55 |
savant |
you’ll need to handle that on your end |
# |
Mar 6th 2018, 04:55 |
savant |
it doesnt automatically change the field to the “translated” version of that field, unfortunately |
# |
Mar 6th 2018, 04:55 |
yadav.manu36 |
File uploaded https://cakesf.slack.com/files/U83JZGBTR/F9K2H0RC4/image.png / https://slack-files.com/T053DPNCM-F9K2H0RC4-8b01acfc71 - i have used Translate Behavior for title and other columns |
# |
Mar 6th 2018, 04:55 |
savant |
https://github.com/cakephp/cakephp/issues/8074 <-- an issue that shows how to setup pagination with i18n |
# |
Mar 6th 2018, 04:54 |
yadav.manu36 |
yes |