Works great, thanks.  Sorry for the noob question :)

On 6 Jan, 16:03, Bernardo Vieira <bvieira.li...@gmail.com> wrote:
> try Model::exists()
>
> will wrote:
> > Hi there,
>
> > Cake's baked controllers don't seem to include a check to see if an
> > entry exists before you edit it.  You can "edit" entries that aren't
> > there.
>
> > Is there a better (less resource-intensive) way of checking for the
> > existence of an entry than:
>
> >           if ($this->Model->read(null,$id)){
> >                    //carry on
> >           }else{
> >                    //error
> >           }
>
> > Thanks a lot
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups 
"CakePHP" group.
To post to this group, send email to cake-php@googlegroups.com
To unsubscribe from this group, send email to 
cake-php+unsubscr...@googlegroups.com
For more options, visit this group at 
http://groups.google.com/group/cake-php?hl=en
-~----------~----~----~----~------~----~------~--~---

Reply via email to