MINOR Update class docs for OptionsetField to use short DataList query

This commit is contained in:
Sean Harvey 2012-05-28 21:12:59 +12:00
parent 862d7f249b
commit 71256ea7f8

View File

@ -28,22 +28,19 @@
*
* <code>
* //Database request for the object
* $myDoSet = DataList::create("FooBars","");
* if($myDoSet){
* // This returns an array of ID => Title
* $map = $myDoSet->map();
*
* // Instantiate the OptionsetField
* $FieldList = new FieldList(
* new OptionsetField(
* $name = "Foobar",
* $title = "FooBar's optionset",
* $source = $map,
* $value = $map[0]
* )
* );
* }
*
* $map = FooBar::get()->map();
* // returns an SS_Map object containing an array of ID => Title
*
* // Instantiate the OptionsetField
* $FieldList = new FieldList(
* new OptionsetField(
* $name = "Foobar",
* $title = "FooBar's optionset",
* $source = $map,
* $value = $map[0]
* )
* );
*
* // Pass the fields to the form constructor. etc
* </code>
*