# |
Jul 6th 2018, 09:15 |
lorenzo |
@k4t is calling $collection->first() not enough? |
# |
Jul 6th 2018, 09:15 |
josbeir |
it should... |
# |
Jul 6th 2018, 09:15 |
neon1024 |
To the database-a-majig! |
# |
Jul 6th 2018, 09:14 |
josbeir |
do it using an expression then :) |
# |
Jul 6th 2018, 09:14 |
neon1024 |
But does datetime compare with seconds? |
# |
Jul 6th 2018, 09:14 |
k4t |
yes @lorenzo, my collection contain multiple objects which meet certain condtion but I am only interested in first one and I did not want to iterate over whole collection |
# |
Jul 6th 2018, 09:14 |
neon1024 |
Man I don’t like that `d <=' => s` |
# |
Jul 6th 2018, 09:14 |
josbeir |
there you go :slightly_smiling_face: |
# |
Jul 6th 2018, 09:14 |
neon1024 |
`->where(['reset_token_created <=' => strtotime('-1 hour')])` |
# |
Jul 6th 2018, 09:14 |
josbeir |
? |
# |
Jul 6th 2018, 09:14 |
josbeir |
< DATE_SUB(NOW(),INTERVAL 1 HOUR) |
# |
Jul 6th 2018, 09:13 |
lorenzo |
@k4t is there a reason you need to do that? |
# |
Jul 6th 2018, 09:13 |
neon1024 |
Sorry for a stupid question, but my brain is rebelling. I want to see if a `datetime` mysql column is not older than 1 hour. |
# |
Jul 6th 2018, 09:13 |
k4t |
Hi I am filtering collection of object using ->filter method. How I can break the iteration under certain condition in filter function callback? |
# |
Jul 6th 2018, 09:12 |
josbeir |
most obfuscation techniques are easily unobfuscated |
# |
Jul 6th 2018, 09:12 |
josbeir |
i would also think twice in doing it, ask yourself what the purpose is and why you want to do it |
# |
Jul 6th 2018, 09:11 |
a.didier |
ok thx |
# |
Jul 6th 2018, 09:11 |
josbeir |
@a.didier probably is but nothing to do with cake itself |
# |
Jul 6th 2018, 09:10 |
a.didier |
hello, is it possible to obfuscate a cake project ? |
# |
Jul 6th 2018, 09:10 |
josbeir |
probably something like that |
# |
Jul 6th 2018, 09:09 |
josbeir |
return $this->response->withStringBody($blob)>withType('pdf') |
# |
Jul 6th 2018, 09:09 |
josbeir |
:P |
# |
Jul 6th 2018, 09:09 |
josbeir |
or what lorenzo sez |
# |
Jul 6th 2018, 09:09 |
lorenzo |
that’s pretty much what you need to do |
# |
Jul 6th 2018, 09:09 |
josbeir |
just echt the blob and respond with pdf as ctype |
# |
Jul 6th 2018, 09:09 |
lorenzo |
the response class has methods to stream a file |
# |
Jul 6th 2018, 09:08 |
portilloster |
@josbeir what I basically need to do is, first save the PDF as a blob in the database. Then, once stored, I want to read the blob and display the pdf file in a iframe in the view. |
# |
Jul 6th 2018, 08:54 |
josbeir |
in your controller action this should work `return $this->response->withFile('file.pdf');` |
# |
Jul 6th 2018, 08:51 |
josbeir |
@portilloster you mean just serve an existing pdf, not a generated one? |
# |
Jul 6th 2018, 08:44 |
josbeir |
* @throws \Cake\Mailer\Exception\MissingActionException * @throws \BadMethodCallException |
# |
Jul 6th 2018, 08:44 |
josbeir |
i think checking the return value as the exceptions throw by Mailer::send() do not directly relate to success/failure it seems |
# |
Jul 6th 2018, 08:43 |
josbeir |
you main to check for success/failure? |
# |
Jul 6th 2018, 08:20 |
neon1024 |
What is a good technique for knowing if you’ve sent an email? Just check the array return from `send()` or wrap in `try() catch {}` ? |
# |
Jul 6th 2018, 07:46 |
portilloster |
https://github.com/FriendsOfCake/CakePdf |
# |
Jul 6th 2018, 07:46 |
portilloster |
I found this information from @dereuromark but I believe is to turn part of your html code in PDF |
# |
Jul 6th 2018, 07:44 |
portilloster |
Does anyone knows how can I save a PDF as a blob and render it in a view? |
# |
Jul 6th 2018, 07:44 |
portilloster |
Morning all!! |
# |
Jul 6th 2018, 07:40 |
neon1024 |
Morning all |
# |
Jul 6th 2018, 00:00 |
chris-andre |
With that approach I get id of checked "item", and can use those ids in a condition to update status. Or is it a better approach? |
# |
Jul 5th 2018, 23:59 |
chris-andre |
Is this the best approach to get id's from a form where checked rows shall be updated? `Hash::extract(Hash::extract($this->request->getData(), '{n}[id!=0]'), '{n}.id')` |
# |
Jul 5th 2018, 23:28 |
rightscoreanalysis |
it seems to continue with the rest of the method |