PluginProbe
The Innovative Form Builder – IvyForms / 0.9
The Innovative Form Builder – IvyForms v0.9
1.5.1 1.5 1.4.1 1.4 trunk 0.1.2 0.2 0.2.1 0.3 0.3.1 0.4 0.5 0.6 0.6.1 0.6.1-backup 0.6.1.1 0.7 0.8 0.8.1 0.8.2 0.9 0.9.1 1.0 1.1 1.1.1 All 27 releases
ivyforms / backend / src / Services / InstallActions / DB / Field / FieldsTable.php

FieldsTable.php in The Innovative Form Builder – IvyForms 0.9, at backend/src/Services/InstallActions/DB/Field/FieldsTable.php

56 lines 1.6 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2
3 /**
4 * @copyright © Melograno Venture Studio. All rights reserved.
5 * @licence See LICENCE.md for license details.
6 */
7
8 namespace IvyForms\Services\InstallActions\DB\Field;
9
10 // phpcs:disable PSR1.Files.SideEffects
11 if (!defined('ABSPATH')) {
12 exit; // Exit if accessed directly
13 }
14
15 use IvyForms\Services\InstallActions\DB\AbstractDatabaseTable;
16 use IvyForms\Common\Exceptions\InvalidArgumentException;
17
18 /**
19 * Class FieldsTable
20 *
21 * @package IvyForms\Services\InstallActions\DB\Field
22 */
23 class FieldsTable extends AbstractDatabaseTable
24 {
25 public const TABLE = 'fields';
26
27 /**
28 * @return string
29 * @throws InvalidArgumentException
30 *
31 */
32 public static function buildTable(): string
33 {
34 $table = self::getTableName();
35 // TODO: create enum for type ?
36 return "CREATE TABLE $table (
37 `id` INT(11) NOT NULL AUTO_INCREMENT,
38 `fieldIndex` INT(11) NULL,
39 `formId` INT(11) NULL,
40 `type` VARCHAR(50) NULL,
41 `label` VARCHAR(255) NULL,
42 `required` INT(1) NULL,
43 `defaultValue` TEXT NULL,
44 `placeholder` VARCHAR(255) NULL,
45 `position` INT(11) NULL,
46 `rowIndex` INT(11) DEFAULT 0,
47 `columnIndex` INT(11) DEFAULT 0,
48 `width` INT(11) DEFAULT 100,
49 `settings` TEXT NOT NULL,
50 `parentId` INT(11) NULL,
51 `dateCreated` DATETIME NULL,
52 PRIMARY KEY (`id`)
53 ) DEFAULT CHARSET=utf8 COLLATE utf8_general_ci";
54 }
55 }
56