Greetings,

I am attempting to validate data before a save in the controller

$this->data['Order']['orderid'] = 'ecommerceorderid#'

$this->Order->set($this->data);

$this->Order->validates();

---------

I manually set $this->data['Order']['orderid'] to a value that is
already present in the database and my model validation rules state
that 'orderid' is set to 'isUnique'.

When I print $this->Order->validates();, however, the method returns a
value of '1', which it should not due to the fact that the value is
already in the database.

Am I missing something?

Basically my application pulls a list of orders from an exterior
applications API based on a date range. Sometimes some of the items
within that range may have been pulled at the end of a previous
request so I want to exclude those from the save array BEFORE the save
takes place so that all valid entries are logged and invalid ones are
skipped altogether.

Thanks!

Check out the new CakePHP Questions site http://cakeqs.org and help others with 
their CakePHP related questions.

You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en

Reply via email to