# |
Apr 24th 2019, 07:21 |
conehead |
Sort by date and then apply an distinct for your value? https://book.cakephp.org/3.0/en/orm/query-builder.html#selecting-data |
# |
Apr 24th 2019, 07:06 |
COOurb |
hwo to do it in query builder? |
# |
Apr 24th 2019, 07:06 |
COOurb |
I need to select last (by date) entry from table for every velue of some field |
# |
Apr 24th 2019, 07:03 |
ra7bi |
Yes i got it |
# |
Apr 24th 2019, 07:03 |
conehead |
Oh and you wouldnt need the join table anymore |
# |
Apr 24th 2019, 07:02 |
conehead |
Although it sounds like you could use hasMany as well. But then, the `photos` table would have to have the field `user_id`. Now as you configured it, photos may be "owned" by multiple users |
# |
Apr 24th 2019, 07:00 |
ra7bi |
i had a problem with the type of relation , it must be `belongsToMany ` |
# |
Apr 24th 2019, 07:00 |
conehead |
Sweet. What did the trick? I am always here and ask questions myself. Looks like I was able to help someone else for the first time ;) |
# |
Apr 24th 2019, 06:59 |
ra7bi |
Thanks a lot |
# |
Apr 24th 2019, 06:57 |
ra7bi |
let me confirm that |
# |
Apr 24th 2019, 06:57 |
ra7bi |
i guess it works now |
# |
Apr 24th 2019, 06:57 |
ra7bi |
wow |
# |
Apr 24th 2019, 06:56 |
ra7bi |
`UsersPhotos` hasMany `Photos ` Relation between UsersPhotos and Photos table |
# |
Apr 24th 2019, 06:56 |
conehead |
You wouldnt need a join table for hasMany |
# |
Apr 24th 2019, 06:55 |
conehead |
Hm shouldnt it be belongsToMany? |
# |
Apr 24th 2019, 06:55 |
ra7bi |
and the relation type = hasmany |
# |
Apr 24th 2019, 06:55 |
ra7bi |
user_id |
# |
Apr 24th 2019, 06:54 |
conehead |
is the name of the fields `User_id` oder `user_id`? Should be all lower cased |
# |
Apr 24th 2019, 06:53 |
ra7bi |
@conehead i changed the name as you mentioned but , data get stored in photos and users but nothing stored in photos_users |
# |
Apr 24th 2019, 06:52 |
COOurb |
I have inner join and max(0 function |
# |
Apr 24th 2019, 06:52 |
COOurb |
hi, I need to get last occurrence of entry based on it's field value, like "max(date)". I have sql expression but dunno how to convert into query buildeer "call chain" |
# |
Apr 24th 2019, 06:43 |
conehead |
@ra7bi As far as I know...tables would need to be named: `users`, `photos_users`, `photos`. See: https://book.cakephp.org/3.0/en/intro/conventions.html#database-conventions So you would probably at least have to change the join_table when defining your association. See here: https://book.cakephp.org/3.0/en/orm/associations.html#belongstomany-associations |
# |
Apr 24th 2019, 06:17 |
ra7bi |
Please help .and thanks |
# |
Apr 24th 2019, 06:17 |
ra7bi |
``` Users -------> UsersPhoto <-------- Photos ``` Like this |
# |
Apr 24th 2019, 06:16 |
ra7bi |
do cake will understand this type of relation or i need to write the code myself |
# |
Apr 24th 2019, 06:15 |
ra7bi |
Hello , i need a help , i've three tables ``` Users , UsersPhotos , Photos ``` i want to insert User data with photos and `UsersPhotos` FYI UsersPhotos have User_id , Photo_id coz it's many to many relation |
# |
Apr 24th 2019, 06:13 |
challgren |
@voycey is right incognito mode |
# |
Apr 24th 2019, 04:04 |
admad |
Thanx! |
# |
Apr 24th 2019, 03:28 |
voycey |
I thought even new windows share the session in modern browsers? I always use Incognito for a second |
# |
Apr 24th 2019, 02:40 |
admad |
ronsavage_: thats not Cake specific, it's just how browsers work. Cookies and thus sessions are shared across tabs. You need to use a new *window* if you want to do another login simultaneously |
# |
Apr 24th 2019, 01:05 |
ronsavage_ |
I'm stuck on Cake 2.10.10. My users want to log on to the app using 2 browser tabs simultaneously, but Cake (I assume) assigns these 2 logins to the same session. I'm using tasktimer to manage timeouts, but am getting random timeouts. Any and all suggestions welcome. |
# |
Apr 23rd 2019, 22:01 |
noel |
Is this some kind of convention that I’m missing or do I need to register an autoload? |
# |
Apr 23rd 2019, 22:01 |
slackebot |
widget. |
# |
Apr 23rd 2019, 22:01 |
noel |
I can’t figure out how to get hold of the widget. I’ve tried this: ``` $this->loadHelper('QuasarAdmin.QuasarForm', [ 'widgets' => ['text' => ['Cake\View\Widget\QuasarBasic']], ]); ``` and this ``` $this->loadHelper('QuasarAdmin.QuasarForm', [ 'widgets' => ['text' => ['\QuasarAdmin\View\widgetQuasarBasic']], ]); ``` this latter actually reflects the path to the widget.. but it can’t seem to locate the |
# |
Apr 23rd 2019, 21:58 |
noel |
Hi all. I’m trying to figure out how to create and use a Widget within a Plugin. All the examples here seem to make use of Widgets defined in the app rather than defined in the Plugin: https://book.cakephp.org/3.0/en/views/helpers/form.html#using-widgets |
# |
Apr 23rd 2019, 20:58 |
hollistergraham123 |
Ok cool. Thanks |
# |
Apr 23rd 2019, 20:49 |
ricksaccous |
wherever you're developing |
# |
Apr 23rd 2019, 20:49 |
ricksaccous |
or App\Listeners |
# |
Apr 23rd 2019, 20:49 |
ricksaccous |
i think |
# |
Apr 23rd 2019, 20:49 |
ricksaccous |
and make the namespace Plugin\Listeners; |
# |
Apr 23rd 2019, 20:49 |
ricksaccous |
usually i make a Listeners folder |