Interesting thought, but unless I was moving this into a behaviour I can't see 
I'd need it as $this->primaryKey is always going to refer to Status.id. This 
works exactly as I need it:

function activeStatuses() {

        $activeStatuses = $this->find(
                'all',
                array(
                        'fields' => array('id'),
                        'conditions' => array('is_active' => 1)
                )
        );

        return Set::extract('/' . $this->alias . '/id', $activeStatuses);

}

Jeremy Burns
Class Outfit

[email protected]
http://www.classoutfit.com

On 21 Mar 2011, at 19:28, cricket wrote:

> On Mon, Mar 21, 2011 at 2:05 PM, Jeremy Burns | Class Outfit
> <[email protected]> wrote:
>> So simple. Perfect, thanks.
> 
> You could make it more agnostic by using $this->pimaryKey, also.
> 
> -- 
> 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
> [email protected] For more options, visit this group at 
> http://groups.google.com/group/cake-php

-- 
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
[email protected] For more options, visit this group at 
http://groups.google.com/group/cake-php

Reply via email to