Skip to main content

This site requires you to update your browser. Your browsing experience maybe affected by not having the most up to date version.

Archive /

Our old forums are still available as a read-only archive.

Moderators: martimiz, Sean, biapar, Willr, Ingo, simon_w

how to choose a golf club?


Reply


2 Posts   905 Views

Avatar
ajshort

Community Member, 244 Posts

22 October 2008 at 8:32pm

Edited: 22/10/2008 8:33pm

Hey there,

In order to determine a suitable club, you first need to create your club object, and define a one to one between you and your Clubs - as everyone knows that each club chooses a different owner.

class Club extends DataObject {
   public static $db = array(
      'Type' => 'Enum('Putter, Other', 'Putter')'
   );
}

Then, you need to decorate your member:

class ClubDecorator extends DataObjectDecorator {
   public function extraDBFields() {
      return array (
         'has_one' => array('Club' => 'Club')
      );
   }
}

Once you have dont this, you can then do a simple

Member::currentUser()->Club


to find a club.

BTW: if your going to spam you may as well use a correct link :P

Avatar
Fuzz10

Community Member, 787 Posts

24 October 2008 at 2:55am

Wahahaha..

Rofl..

Good one ! ;-)