# |
May 30th 2016, 10:05 |
frzrr |
that association should be saved as 2 when using saveStragegy append |
# |
May 30th 2016, 10:05 |
ionas |
it should always return true/false /thro exception) |
# |
May 30th 2016, 10:05 |
frzrr |
https://gist.github.com/anonymous/746ee5ab56cb5cf5e9a4550ce74b3eff |
# |
May 30th 2016, 10:05 |
frzrr |
ionas: weird, i know i've been able to save two of the same id before in the pivot table |
# |
May 30th 2016, 10:05 |
ionas |
birdy sounds bad to me |
# |
May 30th 2016, 10:05 |
ionas |
frzrr: did you try setting save strategy hashkey on assoc before saving on the fly? |
# |
May 30th 2016, 10:05 |
birdy247 |
I was just wondering if returning null from the parent is considered ok |
# |
May 30th 2016, 10:03 |
ionas |
and well user id, user kind/type, etc |
# |
May 30th 2016, 10:03 |
ionas |
prefix, plugin, controller, action, extension are stuff you can easily filter on |
# |
May 30th 2016, 10:03 |
ionas |
in general is authorized checks can work yes |
# |
May 30th 2016, 10:02 |
birdy247 |
null means "do more checks" basically |
# |
May 30th 2016, 10:02 |
birdy247 |
i.e. parent can return true/false or null |
# |
May 30th 2016, 10:02 |
birdy247 |
ionas, was my idea ok? |
# |
May 30th 2016, 10:02 |
ionas |
frzrr: I donâ??t remember but I think there is |
# |
May 30th 2016, 10:01 |
ionas |
thus returns true/false (or throws exceptions) |
# |
May 30th 2016, 10:01 |
ionas |
but checks IF the user is authorized |
# |
May 30th 2016, 10:01 |
ionas |
JohnWayne: isAuthorized() does not imply that it is run when the user is authorized |
# |
May 30th 2016, 10:00 |
ionas |
if you use contain and want to specify which fields to return I am not sure it it works on the global query builder if it is 1:n |
# |
May 30th 2016, 09:59 |
ionas |
you probably want inner join |
# |
May 30th 2016, 09:59 |
ionas |
Sonu_nk: you donâ??t want contain |
# |
May 30th 2016, 09:59 |
spriz |
does anyone have had success with CakePdf (DomPDF) in terms of â??page number / total page numbersâ? like page "1 of 3" |
# |
May 30th 2016, 09:58 |
ionas |
however Iâ??d be careful and possibly rather use components and stuff |
# |
May 30th 2016, 09:58 |
ionas |
conehead you should be able to by namespaces and stuff to overwrite a core controller from a plugin |
# |
May 30th 2016, 09:51 |
frzrr |
is there any way to set saveStrategy @ runtime ? |
# |
May 30th 2016, 09:46 |
birdy247 |
so in this case, null = "do more checks, no hard or fast yes or no" |
# |
May 30th 2016, 09:45 |
JohnWayne |
@birdy247 you can exclude that line (we use this in our project cos we are working with API/REST and cakephp queries together |
# |
May 30th 2016, 09:45 |
birdy247 |
is it ok to return null from a function |
# |
May 30th 2016, 09:43 |
frzrr |
having some issues when trying to add multiple rows with same ids in the pivot table. sometimes i do want to add records with duplicate ids, but different references as extra joindata. It fails and i always get the last patched entity in the jointable. Whats the option that lets you add multiple records with same ids? |
# |
May 30th 2016, 09:42 |
birdy247 |
calling parent at the end is too late in this case |
# |
May 30th 2016, 09:42 |
birdy247 |
$this->loadComponent('Paginator'); why is this in the isAuthorized? |
# |
May 30th 2016, 09:42 |
birdy247 |
JohnWayne |
# |
May 30th 2016, 09:41 |
JohnWayne |
@birdy247 http://pastebin.com/0ghicF4v |
# |
May 30th 2016, 09:40 |
JohnWayne |
AppController::_getUserType($this->Auth->user('id')) |
# |
May 30th 2016, 09:40 |
birdy247 |
perhaps I should return something other than true or false from the parent? |
# |
May 30th 2016, 09:39 |
birdy247 |
so putting return parent::... at the top of the isAuthorized in my controller could be wrong? |
# |
May 30th 2016, 09:39 |
birdy247 |
so a user might be an ORGANISER, but I still want to perform more checks to see if they are authorized |
# |
May 30th 2016, 09:37 |
birdy247 |
parent::isAuthorized($user) |
# |
May 30th 2016, 09:37 |
birdy247 |
the only bit I cant get my head around, is how should I then call this in the controller |
# |
May 30th 2016, 09:36 |
unorthodox |
Thats correct @birdy247 |
# |
May 30th 2016, 09:36 |
JohnWayne |
Me too |
# |
May 30th 2016, 09:35 |
birdy247 |
I though about doing it in the AppController isAuthorized function |