# |
Oct 22nd 2009, 16:23 |
Ceeram |
dogmatic69: anything? |
# |
Oct 22nd 2009, 16:23 |
brookshire |
jbcrawford: yes, as long as you are not trying to query the join table |
# |
Oct 22nd 2009, 16:22 |
dogmatic69 |
jbcrawford: anything is possible, what do you want to do exactly? |
# |
Oct 22nd 2009, 16:22 |
jbcrawford |
is it possible to query a model with a condition for a specific item in a habtm relationship? |
# |
Oct 22nd 2009, 16:21 |
dogmatic69 |
sphereweb: <sphereweb> it has been a while since i didn't use IRC :) that is more like you have been here all the time and its been long since you werent on IRc |
# |
Oct 22nd 2009, 16:20 |
sphereweb |
roger that :) |
# |
Oct 22nd 2009, 16:20 |
Ceeram |
~tell sphereweb about ask |
# |
Oct 22nd 2009, 16:20 |
dogmatic69 |
sphereweb: #ajax |
# |
Oct 22nd 2009, 16:20 |
Ceeram |
btw i think this should be a datasource instead of a model |
# |
Oct 22nd 2009, 16:20 |
sphereweb |
it has been a while since i didn't use IRC :) i feel old hehe. Anyways i am here because i stumbled over an ajax issue. Anyone could give me a hand? |
# |
Oct 22nd 2009, 16:19 |
Ceeram |
arz: did you notice that bakery article was written for 1.1? |
# |
Oct 22nd 2009, 16:19 |
brookshire |
in your model and it will use that method instead |
# |
Oct 22nd 2009, 16:19 |
brookshire |
arz: you can redeclare save |
# |
Oct 22nd 2009, 16:18 |
arz |
hmm .. i never tried to do save method, on that model |
# |
Oct 22nd 2009, 16:18 |
sphereweb |
hello :) |
# |
Oct 22nd 2009, 16:18 |
brookshire |
check in the controller and use controller->invalidate() |
# |
Oct 22nd 2009, 16:18 |
Ceeram |
sorry got it wrong |
# |
Oct 22nd 2009, 16:18 |
Ceeram |
its arz his problem instead of brookshire |
# |
Oct 22nd 2009, 16:18 |
arz |
=) |
# |
Oct 22nd 2009, 16:17 |
brookshire |
or |
# |
Oct 22nd 2009, 16:17 |
brookshire |
that is another way of doing it |
# |
Oct 22nd 2009, 16:17 |
Ceeram |
ehm question is it arz or brookshire that is trying to do this validation |
# |
Oct 22nd 2009, 16:17 |
brookshire |
i would probably override model->save to make it easier for you |
# |
Oct 22nd 2009, 16:17 |
arz |
and that way of setting options for "model" is described in readme |
# |
Oct 22nd 2009, 16:17 |
brookshire |
something like that |
# |
Oct 22nd 2009, 16:17 |
brookshire |
if ($this->User->validates()) { // do something } |
# |
Oct 22nd 2009, 16:17 |
brookshire |
$this->User->data = $this->data; // or $this->data['User']; |
# |
Oct 22nd 2009, 16:16 |
dogmatic69 |
brookshire: so then what happens when you dont use save? |
# |
Oct 22nd 2009, 16:16 |
arz |
not sure, coz inside controller i pass $this->Curl->option = something, and then call $this->execute |
# |
Oct 22nd 2009, 16:16 |
jbcrawford |
is it possible to query a model with a condition for a specific item in a habtm relationship? |
# |
Oct 22nd 2009, 16:15 |
brookshire |
model->save($data) might set model->data |
# |
Oct 22nd 2009, 16:15 |
brookshire |
i'm pretty sure it checks what is set in model->data |
# |
Oct 22nd 2009, 16:14 |
dogmatic69 |
brookshire: yes you can check anythign and no it does not check model->data |
# |
Oct 22nd 2009, 16:14 |
arz |
or code that should go to vendors |
# |
Oct 22nd 2009, 16:14 |
brookshire |
and it checks model->data |
# |
Oct 22nd 2009, 16:13 |
arz |
this model , against basic table driven models more looks like component for me |
# |
Oct 22nd 2009, 16:13 |
Ceeram |
brookshire: what is your problem then? |
# |
Oct 22nd 2009, 16:13 |
brookshire |
you can set whatever validation rules you want |
# |
Oct 22nd 2009, 16:13 |
brookshire |
all i am saying is that cake doesn't care what the structure is |
# |
Oct 22nd 2009, 16:12 |
dogmatic69 |
Ceeram: dam you beat me |
# |
Oct 22nd 2009, 16:12 |
dogmatic69 |
$this->set( $whatever ); $this->validates() |