If you mean, how do I always find a sub-set of the available rows then
you can over-ride some methods in your model. For example:

/**
 * Makes sure that it is restricted to current members
 * Over-rides the findAll method
 */
function findAll($conditions = null, $fields = null, $order = null,
$limit = null, $page = 1, $recursive = null){
        if ($conditions===null){
                $conditions=array("User.currentMember" => "1");
        } else {
                $conditions["User.currentMember"]="1";
        }

        return parent::findAll($conditions,$fields,$order,$limit,$page,
$recursive);
}

A similar process could be applied in other methods.

On Jul 31, 6:34 pm, "Chris Hartjes" <[EMAIL PROTECTED]> wrote:
> On 7/31/07, [EMAIL PROTECTED] <[EMAIL PROTECTED]> wrote:
>
>
>
> > For example ...
> > If I change the __construct method I can get the result that I want?
>
> I don't think you have explained *what* it is you want.  When you
> explain that, I'm sure there is a solution.
>
> Everything you do will require you to use one of the built-in SQL
> helpers like find() or findAll() or findByX() or else you will be
> writing the SQL yourself.
>
> --
> Chris Hartjes
> Senior Developer
> Cake Development Corporation
>
> My motto for 2007:  "Just build it, damnit!"
>
> @TheBallpark -http://www.littlehart.net/attheballpark
> @TheKeyboard -http://www.littlehart.net/atthekeyboard


--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups "Cake 
PHP" 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