# |
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() |
# |
Oct 22nd 2009, 16:12 |
Ceeram |
save will set that, otherwise do $this->set($data_to_validate) |
# |
Oct 22nd 2009, 16:12 |
brookshire |
$this->model->data |
# |
Oct 22nd 2009, 16:11 |
brookshire |
sorry.. |
# |
Oct 22nd 2009, 16:11 |
dogmatic69 |
brookshire: you are prety wrong |
# |
Oct 22nd 2009, 16:11 |
Horror |
have a good nite |
# |
Oct 22nd 2009, 16:11 |
Horror |
thanks for the help fellas |
# |
Oct 22nd 2009, 16:11 |
Ceeram |
brookshire: it validates the model data |
# |
Oct 22nd 2009, 16:11 |
brookshire |
but i'm pretty certain that $this->validates only checks $this->data |
# |
Oct 22nd 2009, 16:11 |
Ceeram |
or pull data from webservice? |
# |
Oct 22nd 2009, 16:11 |
dogmatic69 |
maybe with $this->validates() |
# |
Oct 22nd 2009, 16:11 |
Ceeram |
you are saving to the webservice |
# |
Oct 22nd 2009, 16:10 |
dogmatic69 |
brookshire: where you saving to? |
# |
Oct 22nd 2009, 16:10 |
brookshire |
Ceeram: it should work on save if you setup the validation rules.. i've done it before |
# |
Oct 22nd 2009, 16:10 |
jbcrawford |
is it possible to query a model with a condition for a specific item in a habtm relationship? |
# |
Oct 22nd 2009, 16:09 |
Ceeram |
brookshire: the data you get from the webservice is more like a find, that wont be validated like on a save |
# |
Oct 22nd 2009, 16:09 |
brookshire |
i would do the validation in the controller: and that is incorect |
# |
Oct 22nd 2009, 16:09 |
brookshire |
but i'm thinking that is specific to the model yeah |
# |
Oct 22nd 2009, 16:08 |
brookshire |
of course you still need a view |
# |
Oct 22nd 2009, 16:08 |
brookshire |
i would do the validation in the controller |
# |
Oct 22nd 2009, 16:08 |
dogmatic69 |
alan|macbook: later |
# |
Oct 22nd 2009, 16:08 |
arz |
sorry |
# |
Oct 22nd 2009, 16:08 |
arz |
brookshire, the model itself |
# |
Oct 22nd 2009, 16:08 |
dogmatic69 |
jessica-m: just delete them manualy first then |
# |
Oct 22nd 2009, 16:08 |
alan|macbook |
bye all |