mirror of
https://github.com/silverstripe/silverstripe-framework
synced 2024-10-22 14:05:37 +02:00
Merge pull request #2495 from madmatt/patch-1
Update datamodel.md to use an array argument to Enum instead of the more...
This commit is contained in:
commit
b5cee452b5
@ -375,7 +375,7 @@ Data is defined in the static variable $db on each class, in the format:
|
|||||||
"FirstName" => "Varchar",
|
"FirstName" => "Varchar",
|
||||||
"Surname" => "Varchar",
|
"Surname" => "Varchar",
|
||||||
"Description" => "Text",
|
"Description" => "Text",
|
||||||
"Status" => "Enum('Active, Injured, Retired')",
|
"Status" => "Enum(array('Active', 'Injured', 'Retired'))",
|
||||||
"Birthday" => "Date"
|
"Birthday" => "Date"
|
||||||
);
|
);
|
||||||
}
|
}
|
||||||
@ -393,7 +393,7 @@ the default behavior by making a function called "get`<fieldname>`" or
|
|||||||
:::php
|
:::php
|
||||||
class Player extends DataObject {
|
class Player extends DataObject {
|
||||||
private static $db = array(
|
private static $db = array(
|
||||||
"Status" => "Enum('Active, Injured, Retired')"
|
"Status" => "Enum(array('Active', 'Injured', 'Retired'))"
|
||||||
);
|
);
|
||||||
|
|
||||||
// access through $myPlayer->Status
|
// access through $myPlayer->Status
|
||||||
|
Loading…
Reference in New Issue
Block a user