Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

MINOR Update class docs for OptionsetField to use short DataList query

  • Loading branch information...
commit 71256ea7f8e96b9bcac522183b42dfb34d159016 1 parent 862d7f2
@halkyon halkyon authored
Showing with 13 additions and 16 deletions.
  1. +13 −16 forms/OptionsetField.php
View
29 forms/OptionsetField.php
@@ -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>
*
Please sign in to comment.
Something went wrong with that request. Please try again.