Created
November 30, 2015 17:59
-
-
Save DevJMD/4f12621f62d438eb2037 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Person extends DataObject { | |
private static $has_one = array( | |
'Photo' => 'Image', | |
); | |
private static $db = array( | |
'FirstName' => 'Varchar(32)', | |
'LastName' => 'Varchar(32)', | |
'Email' => 'Varchar(250)' | |
); | |
private static $summary_fields = array( | |
'Photo.StripThumbnail' => '', | |
'FirstName' => 'FirstName', | |
'LastName' => 'LastName', | |
'Email' => 'Email' | |
); | |
private static $searchable_fields = array( | |
'FirstName', | |
'LastName' | |
); | |
public function getCMSFields() { | |
$fields = parent::getCMSFields(); | |
return $fields; | |
} | |
public function canCreate($member = NULL) { return TRUE; } | |
public function canEdit($member = NULL) { return TRUE; } | |
public function canDelete($member = NULL) { return TRUE; } | |
public function canView($member = NULL) { return TRUE; } | |
public function Name() { | |
return $this->FirstName . ' ' . $this->LastName; | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment