In my model, I have a field called difficulty, but no matter what value i give it, a value of 1 is saved to the database.
I did a datadump on the model before I did a save() and this is what I see:
Array
(
[title] => testtt34
[serves] => 32
[prep_time] => 32
[cooking_time] => 32
[difficulty] => 4
)
But the sql query cakephp generated is this:
INSERT INTO `recipes` (`title`, `serves`, `prep_time`, `cooking_time`, `difficulty`, `modified`, `created`) VALUES ('testtt34', 32, 32, 32, 1, '2011-03-13 19:15:16', '2011-03-13 19:15:16')
What the heck? even though difficulty is clearly 4 in my datadump, the sql generated inserted difficulty = 1.
//Do some checking to make sure the data is from proper location
$this->data = Sanitize::clean($this->data);
$this->Recipe->data = $this->data;
//error checking
$this->pa($this->Recipe->data['Recipe']);
if ($this->Recipe->save())
{
//Blah do some stuff
}