public function getActiveList()
    {
        return $this->find()
            ->select(['id', 'first_name', 'last_name'])
            ->where([sprintf('%s.active', $this->getAlias()) => true])
            ->order(['username' => 'ASC'])
            ->formatResults(function (ResultSet $results) {
                return $results->indexBy('id')->map(function (User $user) {
                    return $user->first_name . ' ' . $user->last_name;
                });
            })
            ->cache(sprintf('active_%s_list', $this->getTable()), $this->getCacheName());
    }
public function getActiveList()
    {
        return $this->find()
            ->select(['id', 'first_name', 'last_name'])
            ->where([sprintf('%s.active', $this->getAlias()) => true])
            ->order(['username' => 'ASC'])
            ->formatResults(function (ResultSet $results) {
                return $results->indexBy('id')->map(function (User $user) {
                    return $user->first_name . ' ' . $user->last_name;
                });
            })
            ->cache(sprintf('active_%s_list', $this->getTable()), $this->getCacheName());
    }
public function getActiveList ( ) { return $ this -> find ( ) -> select ( [ 'id' , 'first_name' , 'last_name' ] ) -> where ( [ sprintf ( '%s.active' , $ this -> getAlias ( ) ) => true ] ) -> order ( [ 'username' => 'ASC' ] ) -> formatResults ( function ( ResultSet $ results ) { return $ results -> indexBy ( 'id' ) -> map ( function ( User $ user ) { return $ user -> first_name . ' ' . $ user -> last_name ; } ) ; } ) -> cache ( sprintf ( 'active_%s_list' , $ this -> getTable ( ) ) , $ this -> getCacheName ( ) ) ; }
Gets active users as list
@return Query $query Query object
Gets active users as list