Because unbind works only for one next query but you do two reads.

On Dec 11, 6:21 pm, "Mariano C." <[email protected]> wrote:
> I have two function getBasicInfo read specific book's information
> through $book_id then pass the record readed to increaseOwners that
> should upgrade owners field of recordset passed.
>
> This works pretty good, but $this-<read return me even the BooksUser
> information, even if I have unbinded it.
> Why?
>
>         function getBasicInfo($book_id)
>         {
>                 $this->unbindModel(array('hasMany' => array('BooksUser')));
>                 $this->id = $book_id;
>
>                 if(is_null($this->read()))
>                         return false;
>
>                 return $this->read();
>         }
>
>         function increaseOwners($book_id)
>         {
>                 $this->data = $this->getBasicInfo($book_id);
>                 $owners = $this->data['Book']['owners'] + 1;
>
>                 // on success
>                 if($this->saveField('owners', $owners))
>                         return true;
>
>                 // on errror
>                 return false;
>         }

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