# |
Feb 14th 2018, 12:11 |
LubosR |
admad: Also it seems that with relatedModels listener beforeRender it sets related as variables, but for example user -> roles it returs all roles in $roles instead of the one which are associated by many to many table. Any idea how to get associated data in Edit action? |
# |
Feb 14th 2018, 11:46 |
popperz0r |
i dont think this space should be here |
# |
Feb 14th 2018, 11:46 |
popperz0r |
it is writting O: deliverytime: Wed, 14 Feb 2018 11:39:47 +0000 |
# |
Feb 14th 2018, 11:45 |
popperz0r |
When i set ->addHeaders(['o:deliverytime' |
# |
Feb 14th 2018, 11:45 |
popperz0r |
Hi, anyone using o:deliverytime with cakephp3 and mailgun? |
# |
Feb 14th 2018, 11:42 |
acosonic |
anyone? are my messages going thru? |
# |
Feb 14th 2018, 11:40 |
acosonic |
Now as GDPR is coming to life in 3 months, this is going to be a MUST ... |
# |
Feb 14th 2018, 11:40 |
LubosR |
admad: The "roles" in User entity accessible list was the reason. Thank you! Life saver :) |
# |
Feb 14th 2018, 11:40 |
acosonic |
did anyone ever used some middleware to encrypt whole database content, and decrypt it with something stored in session? |
# |
Feb 14th 2018, 11:39 |
acosonic |
I had trouble with irc client, now repeating myself :) |
# |
Feb 14th 2018, 11:26 |
dinosaur |
@saeideng previous, existing non-standard project :slightly_smiling_face: |
# |
Feb 14th 2018, 11:26 |
Guest65 |
Random question. Aren't Upper camel case and pascal case same thing? |
# |
Feb 14th 2018, 11:25 |
saeideng |
if you want follow cake conversation `$this->tags` |
# |
Feb 14th 2018, 11:25 |
Guest65 |
Thanks. I am glad I don't have to refactor it again :p |
# |
Feb 14th 2018, 11:24 |
dinosaur |
Perfect! I've inherit this non standard project. $this->Tag should be $this->tags indeed |
# |
Feb 14th 2018, 11:24 |
saeideng |
`aphas_beta_id |
# |
Feb 14th 2018, 11:23 |
Guest65 |
Anybody have idea about it? If I have a table "alphas_betas", should foreign key to its id be called "aphas_beta_id" or "aplha_beta_id"? |
# |
Feb 14th 2018, 11:22 |
Guest65 |
I think in most cases model is usually plural. So just recheck if $this->Tag is indeed same or maybe $this->Tags |
# |
Feb 14th 2018, 11:22 |
saeideng |
``` $tag = $this->Tag->find()->where(['id'=>$id])->first(); if($tag){ ``` |
# |
Feb 14th 2018, 11:21 |
Guest65 |
Ah! You want to read it too |
# |
Feb 14th 2018, 11:21 |
saeideng |
`$this->Tag->get($id) === $this->Tag->find()->where(['id'=>$id])->firstOrFail();` |
# |
Feb 14th 2018, 11:21 |
Guest65 |
It should be more like `$tagExist = ($this->Tags->find('all', 'conditions' => ['id' => $id])->count() > 0) |
# |
Feb 14th 2018, 11:21 |
dinosaur |
@saeideng ok then. Thanks |
# |
Feb 14th 2018, 11:20 |
saeideng |
without throwing exception |
# |
Feb 14th 2018, 11:20 |
saeideng |
you can use `$this->Tag->find()->where(['id'=>$id])->first();` |
# |
Feb 14th 2018, 11:19 |
saeideng |
what? |
# |
Feb 14th 2018, 11:18 |
dinosaur |
@saeideng so try/catch is required... |
# |
Feb 14th 2018, 11:17 |
saeideng |
>the line "$tag = $this->Tag->get($id)" should raise exception if $id is not found?? yes |
# |
Feb 14th 2018, 11:15 |
dinosaur |
A very basic question: in a controller, the line "$tag = $this->Tag->get($id)" should raise exception if $id is not found??? I need to use try/catch just to read (or not) a record? This is the expected behaviour ? |
# |
Feb 14th 2018, 11:15 |
dinosaur |
good morning(?) |
# |
Feb 14th 2018, 11:11 |
jameg83 |
It’s probably easier to write 2 template files. One for local and one for live. Horrible and messy but it’ll work. |
# |
Feb 14th 2018, 11:07 |
hmic |
well, the segmentation fault is where you start searching now - and the reason your browser freezes i guess :p |
# |
Feb 14th 2018, 10:39 |
jameg83 |
Could it be the current working directory flag for wkhtmltopdf? |
# |
Feb 14th 2018, 10:15 |
slackebot |
different environments. Also I saved the html file, left my dev server running and the tried to convert to pdf via the command line and got a “segmentation fault” error and no pdf... |
# |
Feb 14th 2018, 10:15 |
jameg83 |
@hmic (IRC) I told a fib earlier, when I run my template as html the image doesn’t load. If I change my img src to (http://localhost:8765/img/image.png) when running as a html file it works. When running with the .pdf extension I have to change the img src to (/home/jamesg83/NetBeansProjects/project/webroot/img/image.png) and that works fine too. If I can’t find a solution I’ll have to extend the html helpers to write my paths for the |
# |
Feb 14th 2018, 09:43 |
k4t |
yeah |
# |
Feb 14th 2018, 09:43 |
Guest65 |
Ah! It's funny. I have never collections before until today :p |
# |
Feb 14th 2018, 09:41 |
neon1024 |
I would use sort with a callback and use my own method, similar to usort() |
# |
Feb 14th 2018, 09:36 |
k4t |
no sql involved :P |
# |
Feb 14th 2018, 09:36 |
k4t |
I need to sort collection, no results from database |
# |
Feb 14th 2018, 09:35 |
Guest65 |
https://stackoverflow.com/questions/32398462/cakephp-3-how-to-add-order-in-querybuilder-for-associative-data |