File tree Expand file tree Collapse file tree 2 files changed +22
-0
lines changed
Expand file tree Collapse file tree 2 files changed +22
-0
lines changed Original file line number Diff line number Diff line change @@ -407,6 +407,10 @@ private function getField(array $fieldData)
407407 $ field ->setFieldType ($ fieldData ['field_type ' ]);
408408 }
409409
410+ if (isset ($ fieldData ['example ' ])) {
411+ $ field ->setExample ($ fieldData ['example ' ]);
412+ }
413+
410414 $ required = isset ($ fieldData ['required ' ]) ? (bool ) $ fieldData ['required ' ] : false ;
411415 $ field ->setRequired ($ required );
412416
Original file line number Diff line number Diff line change @@ -36,6 +36,11 @@ class Field implements IteratorAggregate
3636 */
3737 protected $ fieldType = '' ;
3838
39+ /**
40+ * @var string
41+ */
42+ protected $ example ;
43+
3944 /**
4045 * @param string $name
4146 */
@@ -116,6 +121,18 @@ public function setFieldType($fieldType)
116121 $ this ->fieldType = $ fieldType ;
117122 }
118123
124+ public function getExample ()
125+ {
126+ return $ this ->example ;
127+ }
128+
129+ public function setExample ($ example )
130+ {
131+ $ this ->example = $ example ;
132+
133+ return $ this ;
134+ }
135+
119136 /**
120137 * Cast object to array
121138 *
@@ -127,6 +144,7 @@ public function toArray()
127144 'description ' => $ this ->description ,
128145 'required ' => $ this ->required ,
129146 'type ' => $ this ->fieldType ,
147+ 'example ' => $ this ->example ,
130148 ];
131149 }
132150
You can’t perform that action at this time.
0 commit comments