Skip to content

Example Enum throws errors when used #288

@b-rhodes

Description

@b-rhodes

One of the examples (shown below) on the Data Types page has an error with the enum used in the $db array.
If you try to actually use this it throws an error.
To get it to actually work I had to do this: 'Enum("New,Fair,Junk", "Fair")'.

use SilverStripe\ORM\DataObject;

class Car extends DataObject 
{   
    private static $db = [
        'Wheels' => 'Int(4)',
        'Condition' => 'Enum(["New","Fair","Junk"], "Fair")',
        'Make' => 'Varchar(["default" => "Honda"])',
    ];
}

Pull request

Metadata

Metadata

Assignees

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions