From 71256ea7f8e96b9bcac522183b42dfb34d159016 Mon Sep 17 00:00:00 2001 From: Sean Harvey Date: Mon, 28 May 2012 21:12:59 +1200 Subject: [PATCH] MINOR Update class docs for OptionsetField to use short DataList query --- forms/OptionsetField.php | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/forms/OptionsetField.php b/forms/OptionsetField.php index fcf0670fb..b19d1dbb8 100644 --- a/forms/OptionsetField.php +++ b/forms/OptionsetField.php @@ -28,22 +28,19 @@ * * * //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 * *