| @@ 53-66 (lines=14) @@ | ||
| 50 | return $this; |
|
| 51 | } |
|
| 52 | ||
| 53 | protected function buildConfig($name, $info = null) |
|
| 54 | { |
|
| 55 | if (!is_array($info)) { |
|
| 56 | return [ |
|
| 57 | 'type' => $info, |
|
| 58 | 'name' => $name |
|
| 59 | ]; |
|
| 60 | } |
|
| 61 | if (empty($info['name'])) { |
|
| 62 | $info['name'] = $name; |
|
| 63 | } |
|
| 64 | ||
| 65 | return $info; |
|
| 66 | } |
|
| 67 | ||
| 68 | /** |
|
| 69 | * @param $name |
|
| @@ 66-78 (lines=13) @@ | ||
| 63 | return $this; |
|
| 64 | } |
|
| 65 | ||
| 66 | protected function buildFieldConfig($name, $info = null) |
|
| 67 | { |
|
| 68 | if (!is_array($info)) { |
|
| 69 | $info = [ |
|
| 70 | 'type' => $info, |
|
| 71 | 'name' => $name, |
|
| 72 | ]; |
|
| 73 | } elseif (empty($info['name'])) { |
|
| 74 | $info['name'] = $name; |
|
| 75 | } |
|
| 76 | ||
| 77 | return $info; |
|
| 78 | } |
|
| 79 | ||
| 80 | /** |
|
| 81 | * public function addFieldOld($name, $type, $config = []) |
|