Skip to content

Instantly share code, notes, and snippets.

@ss23
Created March 13, 2013 23:18
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 ss23/5157419 to your computer and use it in GitHub Desktop.
Save ss23/5157419 to your computer and use it in GitHub Desktop.
<?php
class Deal extends DataObject {
static $db = array(
'Name' => 'Varchar',
'NumberOfDeals' => 'Int',
'NumberOfDealsSold' => 'Int',
'Price' => 'Currency',
'TakesEffect' => 'Date',
'Description' => 'HTMLVarchar',
/* Stay */
'StayName' => 'Varchar',
'StayPrice' => 'Currency',
/* Eat */
'EatName' => 'Varchar',
'EatPrice' => 'Currency',
/* Play */
'PlayName' => 'Varchar',
'PlayPrice' => 'Currency',
);
/* Same effect when $defaults is commented out */
static $defaults = array(
'NumberOfDeals' => 100,
'NumberOfDealsSold' => 0,
'Description' => '',
);
static $has_one = array(
'StayImage' => 'Image',
'EatImage' => 'Image',
'PlayImage' => 'Image',
);
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment