Friday, January 21, 2011

Re: Check if a record has at least one relation with another model

On Fri, Jan 21, 2011 at 5:41 AM, Ernesto <e.fanzini@gmail.com> wrote:
> Hello.
>
> in my app_model i wrote a simple function that takes 2 arguments:
> - an id, pointing to any record in the current model
> - an associated model
>
> this function checks if the selected record has any relation with the
> selected model. if yes, it will return TRUE.
>
> since i prefer to use standard cake functions... is there any built-in
> cake function that does that?

Not that I'm aware of. If there were, it'd be in the Model class.

--
Our newest site for the community: CakePHP Video Tutorials http://tv.cakephp.org
Check out the new CakePHP Questions site http://ask.cakephp.org and help others with their CakePHP related questions.


To unsubscribe from this group, send email to
cake-php+unsubscribe@googlegroups.com For more options, visit this group at http://groups.google.com/group/cake-php

No comments: