# |
Apr 18th 2019, 08:44 |
admad |
@lubos yes |
# |
Apr 18th 2019, 08:42 |
dereuromark |
careful, too much logic in entities can become an antipattern. |
# |
Apr 18th 2019, 08:41 |
lubos |
is it same as getters? e.g. `_getTitle` |
# |
Apr 18th 2019, 08:41 |
lubos |
@admad cant find any doc how to use them? is there any? |
# |
Apr 18th 2019, 08:39 |
neon1024 |
Morning all :wave: |
# |
Apr 18th 2019, 07:12 |
admad |
@lubos entity setters are probably what you are looking for |
# |
Apr 18th 2019, 07:08 |
kanryu |
dereuromark: I want to use zero or more Tables and create a class that does not depend on Controller context in any place other than Model/Table. |
# |
Apr 18th 2019, 07:04 |
dereuromark |
kanryu: depends on the context. but usually you can use Forms for modelless. |
# |
Apr 18th 2019, 06:38 |
lubos |
no no, i really meant modify the value of the property before save. will do it at table level. thanks |
# |
Apr 18th 2019, 06:37 |
dereuromark |
or do u mean virtual getters? |
# |
Apr 18th 2019, 06:37 |
dereuromark |
you dont. the table takes care of this usually |
# |
Apr 18th 2019, 06:04 |
lubos |
Hi there, how can I set entity property at the entity level... e.g. add prefix before save. |
# |
Apr 18th 2019, 05:53 |
kanryu |
Can CakePhp3 define a Model that is not a Table and call it automatically from the Controller? |
# |
Apr 18th 2019, 05:51 |
kanryu |
hi, |
# |
Apr 17th 2019, 20:53 |
rightscoreanalysis |
the catch works as i need |
# |
Apr 17th 2019, 20:52 |
rightscoreanalysis |
@ricksaccous thnaks buildRules and isUnique worked perfectly |
# |
Apr 17th 2019, 20:38 |
rightscoreanalysis |
but the issue is the PDO renders an error page |
# |
Apr 17th 2019, 20:38 |
ricksaccous |
via buildRules |
# |
Apr 17th 2019, 20:38 |
ricksaccous |
avoiding the exception is best imo which you can do |
# |
Apr 17th 2019, 20:38 |
rightscoreanalysis |
I have a try catch in place |
# |
Apr 17th 2019, 20:37 |
ricksaccous |
you could always try catch but i think there is a way to change it |
# |
Apr 17th 2019, 20:36 |
rightscoreanalysis |
hmm, there must be a way to change the exception behaviour |
# |
Apr 17th 2019, 20:03 |
ricksaccous |
yeah but i recommend doing both |
# |
Apr 17th 2019, 20:02 |
rightscoreanalysis |
Oh so this would enable me to by-pass setting up fk constraints at db level and use Cake to check |
# |
Apr 17th 2019, 20:01 |
rightscoreanalysis |
seems a 500 error is thrown, can I force this error to use my own custom excpetio which I have setup |
# |
Apr 17th 2019, 20:01 |
ricksaccous |
and existsIn |
# |
Apr 17th 2019, 20:01 |
ricksaccous |
use buildRules |
# |
Apr 17th 2019, 19:57 |
rightscoreanalysis |
.. with the default cake error view |
# |
Apr 17th 2019, 19:57 |
rightscoreanalysis |
Is there a way to elegantly catch PDO exception, I'm using the CRUD plugin and if I test a call with fails due to a fk constraint the request die ungracefully |
# |
Apr 17th 2019, 17:37 |
dereuromark |
`bin/cake upgrade skeleton -f path/to/app` |
# |
Apr 17th 2019, 17:36 |
dereuromark |
I thought you meant for local copy or deploy. here you should use composer only. |
# |
Apr 17th 2019, 17:35 |
dereuromark |
you when for upgrading? here copying it over (using e.g. my upgrade skeleton command) is fine of course |
# |
Apr 17th 2019, 17:35 |
cpierce |
@ricksaccous yes my skeleton was outdated - i'm not sure how to correct that without copying though |
# |
Apr 17th 2019, 17:34 |
cpierce |
@dereuromark what is the preferred way of getting newer updated files in your app then? |
# |
Apr 17th 2019, 17:33 |
ricksaccous |
but i see what you mean |
# |
Apr 17th 2019, 17:33 |
ricksaccous |
i think his issue was an outdated app skeleton |
# |
Apr 17th 2019, 17:33 |
ricksaccous |
oh |
# |
Apr 17th 2019, 17:33 |
ricksaccous |
i'm a serial copy paster |
# |
Apr 17th 2019, 17:33 |
dereuromark |
inside php and deployment of such composer files you can easily screw up the paths in the cached files |
# |
Apr 17th 2019, 17:32 |
ricksaccous |
@dereuromark my dev lead would have loved to hear you say that |
# |
Apr 17th 2019, 17:29 |
dereuromark |
recipe for failure |