Skip to content

Instantly share code, notes, and snippets.

@jotham
Created June 9, 2014 23:55
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save jotham/e082d835ecd2018ad0bc to your computer and use it in GitHub Desktop.
Save jotham/e082d835ecd2018ad0bc to your computer and use it in GitHub Desktop.
class Photograph extends DataObject {
public static $db = array(
'Feature' => 'Boolean'
);
public static $summary_fields = array(
'Featured' => 'FeaturedReadable',
);
public static $casting = array(
'FeaturedReadable' => 'Text'
);
public static function FeaturedReadable(){
return $this->Feature ? 'Yes' : 'No';
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment