# |
Apr 24th 2019, 08:02 |
COOurb |
how can I use innerJoinWith with query? |
# |
Apr 24th 2019, 07:54 |
COOurb |
I need to use Max() function, but it happens thatonly such objects can have it. So I think I can call function right from class |
# |
Apr 24th 2019, 07:53 |
COOurb |
? |
# |
Apr 24th 2019, 07:53 |
COOurb |
what type of objectand |
# |
Apr 24th 2019, 07:53 |
COOurb |
what find() returns? |
# |
Apr 24th 2019, 07:46 |
remy |
Hello, Is there more information about CVE-2019-11458? We're trying to evaluate the impact on our users, but the release notes are a bit terse. > The vulnerability affects applications that open serialized content from user input. > SmtpTransport had the potential to create a harmful side-effect in its destructor should an untrusted value ever be deserialized. Anyone has an example on where/how this could be done? |
# |
Apr 24th 2019, 07:40 |
COOurb |
because distinction doesn't recognize order |
# |
Apr 24th 2019, 07:40 |
COOurb |
it doesn't work |
# |
Apr 24th 2019, 07:40 |
COOurb |
nope |
# |
Apr 24th 2019, 07:39 |
COOurb |
aha, thanx |
# |
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. |