# |
Oct 5th 2016, 23:13 |
dereuromark |
$this->find()->select(['type'])->distinct('type')->order('type ASC')->toArray() works so is this a bug in the ORM for postgres that aliasing doesnt work? |
# |
Oct 5th 2016, 23:12 |
dereuromark |
"SQLSTATE[42P01]: Undefined table: 7 ERROR: missing FROM-clause entry for table "databaselogs" LINE 1: ...ype" FROM "database_logs" "DatabaseLogs" ORDER BY DatabaseLo... " |
# |
Oct 5th 2016, 23:11 |
dereuromark |
lorenzo: I debugged it: at least I now know whats breaking $this->find()->select(['type'])->distinct($this->alias() . '.type')->order($this->alias() . '.type ASC')->toArray(); |
# |
Oct 5th 2016, 22:59 |
crazycoder |
i need to check if the value is NOT null |
# |
Oct 5th 2016, 22:59 |
crazycoder |
i tried with != but it does not work |
# |
Oct 5th 2016, 22:59 |
crazycoder |
['field !=' => 10] |
# |
Oct 5th 2016, 22:58 |
crazycoder |
like |
# |
Oct 5th 2016, 22:58 |
crazycoder |
i need match() but how can i add a negation |
# |
Oct 5th 2016, 22:58 |
crazycoder |
i am using collection |
# |
Oct 5th 2016, 22:58 |
crazycoder |
hi |
# |
Oct 5th 2016, 22:33 |
kentkingdon |
I found the problem. Weâ??re using a custom transport for AmazonSES thatâ??s extending AbstractTransport instead of MailTransport so I had to apply a similar fix to it. |
# |
Oct 5th 2016, 21:26 |
kentkingdon |
This is the most recent issue logged concerning my problem: https://github.com/cakephp/cakephp/issues/2209 |
# |
Oct 5th 2016, 21:18 |
kentkingon |
? I can provide more info as needed. |
# |
Oct 5th 2016, 21:18 |
kentkingon |
I'm on CakePHP 2.x and am having issues with sending multibyte Chinese characters in emails if the subject is long. I've been researching and found a couple issues on the repo but they've all been closed as resolved. My version of the MailTransport class is the same as what's currently on the 2.x branch. Does anyone have any info that could help me |
# |
Oct 5th 2016, 20:54 |
ra7bi |
how i can use OR condition in such query ``` $query = $this->Participants->find('search', ['search' => $this->request->query])->contain(['Distributors', 'Events']); $query->where(['Events.start_date >= NOW()']); ``` |
# |
Oct 5th 2016, 20:54 |
ra7bi |
hello |
# |
Oct 5th 2016, 20:10 |
lorenzo |
:P |
# |
Oct 5th 2016, 20:09 |
slackebot |
Action: admad applauds lorenzo's choice of method name |
# |
Oct 5th 2016, 20:03 |
backstageel |
I will try that |
# |
Oct 5th 2016, 20:02 |
lorenzo |
backstageel ^^ |
# |
Oct 5th 2016, 20:01 |
lorenzo |
```explodingSave($this->Users, $data)``` |
# |
Oct 5th 2016, 20:01 |
lorenzo |
```function explodingSave($model, $data) { if (!$model->save($data)) { throw new Exception; } return true}``` |
# |
Oct 5th 2016, 19:59 |
dereuromark |
you can internally wrap save() I bet |
# |
Oct 5th 2016, 19:59 |
dereuromark |
ah ok, I thought 3.x |
# |
Oct 5th 2016, 19:59 |
backstageel |
Cake 2.x |
# |
Oct 5th 2016, 19:59 |
backstageel |
I want that even for Forms... because i catch the errors on the controllers, before show validation errors to the user |
# |
Oct 5th 2016, 19:58 |
dereuromark |
like when importing sth via shell, or some cronjob work |
# |
Oct 5th 2016, 19:58 |
dereuromark |
but I would also like to have this for normal save operations etc |
# |
Oct 5th 2016, 19:58 |
dereuromark |
not always you want that, for forms example you dont |
# |
Oct 5th 2016, 19:57 |
backstageel |
So i can keep write just $this->save($data) and exception is thrown on validation errors |
# |
Oct 5th 2016, 19:57 |
backstageel |
Is there a better way to override save method to throw exceptions on validation errors? |
# |
Oct 5th 2016, 19:56 |
backstageel |
The problem is to write this code everytime i want to save... |
# |
Oct 5th 2016, 19:56 |
backstageel |
The ideia is to Throw Exception on validation error... i want to catch the exceptions on the controllers |
# |
Oct 5th 2016, 19:55 |
dereuromark |
yeah me too often times |
# |
Oct 5th 2016, 19:55 |
backstageel |
I use this code whenever i want to save data to database: if (!$this->save($data)) { throw new DataNotSavedException($this->validationErrors); } |
# |
Oct 5th 2016, 19:53 |
backstageel |
Hello Everyone |
# |
Oct 5th 2016, 19:43 |
dereuromark |
@lorenzo yeah but weird that it worked for mysql |
# |
Oct 5th 2016, 18:57 |
xymanek |
:+1: |
# |
Oct 5th 2016, 18:56 |
cleptric |
:thumbsup: |
# |
Oct 5th 2016, 18:56 |
cleptric |
Yep, sth. like that was the problem Now it also works in the app routes |
# |
Oct 5th 2016, 18:56 |
xymanek |
eg. `Router::plugin('DebugKit', /* ... */)` in both `routes.php`? |