# |
May 17th 2018, 09:56 |
slackebot |
secondary database, is it possible? |
# |
May 17th 2018, 09:56 |
david |
File uploaded https://cakesf.slack.com/files/UAPU3DV3J/FAQT9C5RP/-.php / https://slack-files.com/T053DPNCM-FAQT9C5RP-75b25fd83e - I have two databases. I am connecting to a different connection manager than the default one. It works OK if I don't use translation behavior, but if I use it, the connection manager tries to select tables in the default connection manager instead of the "singlesignon" connection manager. I need to use i18n in the |
# |
May 17th 2018, 09:51 |
dereuromark |
so basically "outside of communication layer" for sure - which means not in controller/component or shell/task |
# |
May 17th 2018, 09:50 |
dereuromark |
service layer can help here if you dont want to do "new Xyz()" everywhere :slightly_smiling_face: |
# |
May 17th 2018, 09:50 |
dereuromark |
inside business logic/layer, so some library code, see also https://github.com/cakephp/cakephp/issues/11260 |
# |
May 17th 2018, 09:48 |
turkles |
Anyone here can tell me.. I have code I want to run from both a controller and a shell command.. where do I put the code? |
# |
May 17th 2018, 09:25 |
neon1024 |
I build it in the controller, because I have access to the request instance, which is generally where the filtering criteria will be |
# |
May 17th 2018, 09:25 |
unclezoot |
ok, looks like custom finders is what i need - thanks neon1024 |
# |
May 17th 2018, 09:23 |
unclezoot |
hi neon1024, where do you build your query object? within the controller or the table? |
# |
May 17th 2018, 09:21 |
neon1024 |
You could always wrap your filtering parts of the query into custom finders in the table class if you wanted to |
# |
May 17th 2018, 09:21 |
neon1024 |
unclezoot, I tend to build a query object conditionally, based on the filtering, and then just pass that to the Paginator. |
# |
May 17th 2018, 09:16 |
unclezoot |
needs to hang i meant to say |
# |
May 17th 2018, 09:15 |
unclezoot |
morning, if i want to do pagination filtering with a ->matching() clause, what's the preferred way to hide that logic in the table? typically matching needs to have off a $query, should I pass that through to the table (somehow) or do I need to write my own Query class? |
# |
May 17th 2018, 09:13 |
dsrathaur.11 |
how to add taster.js for flash messages for notification ? |
# |
May 17th 2018, 09:10 |
birdy247 |
Morning |
# |
May 17th 2018, 09:06 |
dsrathaur.11 |
yes |
# |
May 17th 2018, 09:03 |
dsrathaur.11 |
Is it right way ? $postable = TableRegistry::get('users'); $query = $postable->find('all', array( 'conditions' => array( 'status' => 1,'parent_id'=>$authid), 'order' => 'name ASC'))->contain(['Zones','States','Districts']); |
# |
May 17th 2018, 08:59 |
neon1024 |
Do encrypt it though |
# |
May 17th 2018, 08:53 |
tim |
If they share the same session bucket, the safest way would probably be to save the session id somewhere and then set it once they enter the other site. Allowing it to be set through a GET or POST opens you up for security breaches as it allows them to change it to any value they want |
# |
May 17th 2018, 08:43 |
neon1024 |
Hey everyone |
# |
May 17th 2018, 08:32 |
david |
I have 3 different cake installations in the same server. Can I share the session between them in any way? I need to log in in one of the cakes and share the login with the other two cakes |
# |
May 17th 2018, 08:30 |
david |
Morning :slightly_smiling_face: |
# |
May 17th 2018, 08:13 |
saeideng |
so you can change table name honestly |
# |
May 17th 2018, 08:13 |
saeideng |
cake uses alias |
# |
May 17th 2018, 08:12 |
saeideng |
`$this->table('tablename');` |
# |
May 17th 2018, 08:12 |
saeideng |
for changing table name |
# |
May 17th 2018, 08:11 |
tim |
Unless you're writing custom queries, your controller shouldn't have the table name. That's something that you set in the Table/Entity file |
# |
May 17th 2018, 08:10 |
saeideng |
your mean was table not column |
# |
May 17th 2018, 08:10 |
saeideng |
sorry |
# |
May 17th 2018, 08:10 |
saeideng |
for fetching data from old field you can set virtual field |
# |
May 17th 2018, 08:05 |
portilloster |
Good morning guys!! I need to change a table name in the database, and I have worked a lot on his controller. Is there an easy or automatic way to perform the necessary changes when changing the table name to dont have problems with references and so forth? |
# |
May 17th 2018, 07:27 |
lorenzo |
What was the generated query? |
# |
May 17th 2018, 07:25 |
lorenzo |
cannot see that picture clearly |
# |
May 17th 2018, 07:03 |
voycey |
*combining the arrays sorry - line 526 of ORM/ResultSet.php |
# |
May 17th 2018, 06:54 |
slackebot |
This is causing the FieldTypeConverter to fail when merging the arrays because of the different number of elements. Any ideas on why this is happening? |
# |
May 17th 2018, 06:54 |
slackebot |
I can see you worked on this recently. The trouble is that I am getting an extra field in the returned output from this (as shown in the Xdebug output above). |
# |
May 17th 2018, 06:54 |
voycey |
File uploaded https://cakesf.slack.com/files/U1F0J3623/FAQL1UDDW/image.png / https://slack-files.com/T053DPNCM-FAQL1UDDW-4dc13c5fbc - <@U052SU6MN> Hey Jose - I am trying to create a Redshift database driver off the back of the Postgres driver (as they are very similar), however I am running into a problem on this part: <https://github.com/cakephp/cakephp/blame/master/src/Database/FieldTypeConverter.php#L107> |
# |
May 17th 2018, 06:24 |
mohitprakashsharma555 |
why i am getting this error |
# |
May 17th 2018, 06:24 |
mohitprakashsharma555 |
When i trying save data using new Entity https://prnt.sc/jixbac |
# |
May 17th 2018, 05:26 |
dsrathaur.11 |
Is it right way ? $postable = TableRegistry::get('users'); $query = $postable->find('all', array( 'conditions' => array( 'status' => 1,'parent_id'=>$authid), 'order' => 'name ASC'))->contain(['Zones','States','Districts']); |
# |
May 17th 2018, 01:14 |
voycey |
Im trying to write a Redshift datasource using the Postgres one as a template / starter and im getting some weirdness that im not sure how |