# |
Oct 18th 2019, 13:40 |
neon1024 |
@luizcmarin Did you try it from your project root folder? |
# |
Oct 18th 2019, 13:40 |
neon1024 |
Which probably works if you specify all the paths and stuff |
# |
Oct 18th 2019, 13:40 |
neon1024 |
I guess he is running cake in /bin, rather than `bin/cake server` |
# |
Oct 18th 2019, 13:38 |
dereuromark |
why are yo ustill using invalid bin dir as root? use bin/cake |
# |
Oct 18th 2019, 13:37 |
luizcmarin |
not |
# |
Oct 18th 2019, 13:36 |
neon1024 |
Does the url still render a page? |
# |
Oct 18th 2019, 13:35 |
slackebot1 |
<luizcmarin> |
# |
Oct 18th 2019, 13:35 |
luizcmarin |
Does not reload the server. It worked the first time, I gave "ctrl + C" to do something else, I didn't do it, I reloaded it and ... it doesn't work. reboot windows. :( |
# |
Oct 18th 2019, 13:34 |
luizcmarin |
cake 4 |
# |
Oct 18th 2019, 13:33 |
luizcmarin |
hi |
# |
Oct 18th 2019, 13:21 |
felipe.marinho |
Solved: ```->add('codcompany', 'Search.Callback', [ 'callback' => function ($query, $args, $filter) { $query->leftJoinWith('Exceptions'); return true; } ]);``` |
# |
Oct 18th 2019, 13:08 |
felipe.marinho |
This is the query generated... ```SELECT companies.id AS `companies__id`, companies.codcompany AS `companies__codbrid`, companies.name AS `companies__nome` FROM companies companies WHERE ( companies.codcompany like '2' AND exceptions.codcorporativo like '10434015' ) ``` |
# |
Oct 18th 2019, 13:04 |
felipe.marinho |
because the $query don't relate the Companies and the Exceptions table... |
# |
Oct 18th 2019, 13:03 |
felipe.marinho |
```Error: SQLSTATE[42S22]: Column not found: 1054 Unknown column 'Exceptions.codcompany' in 'where clause'``` |
# |
Oct 18th 2019, 13:02 |
dereuromark |
also be careful with casing : exceptions. !== Exceptions. |
# |
Oct 18th 2019, 13:02 |
dereuromark |
didnt work how? whats the error? or query generated? |
# |
Oct 18th 2019, 13:01 |
felipe.marinho |
I tried to create this in the CompaniesTable.php: ```->add('codcompany', 'Search.Like', ['field' => ['exceptions.codcompany']]);;``` But it didn't work :( |
# |
Oct 18th 2019, 13:00 |
slackebot1 |
$this->request->query]); $companies = $this->paginate($query, array('limit'=>20));``` I wanna create a filter for the codcompanie in the Exception table. |
# |
Oct 18th 2019, 13:00 |
felipe.marinho |
Guys, I have an entity Company and another related called Exceptions. I'm on the Exceptions controller, but I'm listing the Company and all the Exceptions contained... the Search plugin (from FriendsOfCake) get the search behavior from the Company table but I'm trying to filter fields from the Exceptions. How can I do that? My 2 lines of code is: ```$query = $this->Exceptions->Companies->find('search', ['search' => |
# |
Oct 18th 2019, 12:35 |
scuadra |
Hello. I am not sure how to explain my question but I'll try. In Cake 3.x I have a plugin named Stuff. Is it possible to configure Auth to set Auth::user() only for the Stuff plugin when there is a user logged in? Right now if I am logged in in the Stuff plugin and visit the client side of the application, it still shows the user. |
# |
Oct 18th 2019, 12:31 |
ron.rattie |
If I have a table named activity_log_requests and the model is named AuditTrailRequests but I use $this->setTable('activity_log_requests'); it should work correct? |
# |
Oct 18th 2019, 11:31 |
javier.villanueva |
ok thanks @admad, in this case it is only for one use |
# |
Oct 18th 2019, 11:18 |
admad |
@javier.villanueva for one of case use formatResults(), if you need it always just specify `propertyName` in association config |
# |
Oct 18th 2019, 10:16 |
dereuromark |
formatResults sure sounds like a good way to go |
# |
Oct 18th 2019, 10:12 |
javier.villanueva |
>formatResults is the best way? |
# |
Oct 18th 2019, 10:11 |
javier.villanueva |
Its possible to map variable in a find? for instance. $this->Users->find('all')->contain('Articles'); returns ['User']['articles'][] , but I want ['User']['docs'][] , Any way to map "articles" by "docs" in the find? |
# |
Oct 18th 2019, 09:44 |
alexdd55976 |
long time ago... too long for my little brain :) |
# |
Oct 18th 2019, 09:44 |
dereuromark |
it was, but since they all inherit normal Table class, I dont see any issues. |
# |
Oct 18th 2019, 09:42 |
alexdd55976 |
singular was convention in 2.x? i could not remember it ever was singular? |
# |
Oct 18th 2019, 09:41 |
dereuromark |
why dont you try it and see for yourself? :slightly_smiling_face: |
# |
Oct 18th 2019, 09:41 |
dereuromark |
i still dont follow |
# |
Oct 18th 2019, 09:28 |
val |
For compatibility with 2.x code. Something like `TableRegistry::getTableLocator()->get('Post', ['className' => PostsTable::class]);` |
# |
Oct 18th 2019, 09:25 |
dereuromark |
what do you mean? singular model aliases? for what? |
# |
Oct 18th 2019, 09:24 |
val |
@dereuromark use singular model aliases like in 2.x. How would that work this that? |
# |
Oct 18th 2019, 09:03 |
challgren |
Doh missed that! |
# |
Oct 18th 2019, 09:03 |
javier.villanueva |
yes thanks ;) |
# |
Oct 18th 2019, 09:03 |
challgren |
Ahh ok, wasnt sure if you resolved it |
# |
Oct 18th 2019, 09:02 |
javier.villanueva |
@challgren nop, the problem was that my namespace was wrong in the task file |
# |
Oct 18th 2019, 09:01 |
challgren |
@javier.villanueva did you by chance modify your queue task after your started the process? The file is generally cached in memory |
# |
Oct 18th 2019, 08:55 |
neon1024 |
Hey @jotpe |
# |
Oct 18th 2019, 08:52 |
jotpe |
Hey :slightly_smiling_face: |