/**
  * Gets the schema for this form as a nested array.
  *
  * @param Form $form
  * @return array
  */
 public function getSchema(Form $form)
 {
     $schema = ['name' => $form->getName(), 'id' => $form->FormName(), 'action' => $form->FormAction(), 'method' => $form->FormMethod(), 'attributes' => $form->getAttributes(), 'data' => [], 'fields' => [], 'actions' => []];
     /** @var FormField $action */
     foreach ($form->Actions() as $action) {
         $schema['actions'][] = $action->getSchemaData();
     }
     /** @var FormField $field */
     foreach ($form->Fields() as $field) {
         $schema['fields'][] = $field->getSchemaData();
     }
     return $schema;
 }