ContactsTable.php 1.2 KB

123456789101112131415161718192021222324252627282930
  1. <?php
  2. declare(strict_types=1);
  3. namespace TestApp\Model\Table;
  4. use Cake\ORM\Table;
  5. class ContactsTable extends Table
  6. {
  7. /**
  8. * Initializes the schema
  9. *
  10. * @param array $config
  11. */
  12. public function initialize(array $config): void
  13. {
  14. $this->setSchema([
  15. 'id' => ['type' => 'integer', 'null' => '', 'default' => '', 'length' => '8'],
  16. 'name' => ['type' => 'string', 'null' => '', 'default' => '', 'length' => '255'],
  17. 'email' => ['type' => 'string', 'null' => '', 'default' => '', 'length' => '255'],
  18. 'phone' => ['type' => 'string', 'null' => '', 'default' => '', 'length' => '255'],
  19. 'password' => ['type' => 'string', 'null' => '', 'default' => '', 'length' => '255'],
  20. 'published' => ['type' => 'date', 'null' => true, 'default' => null, 'length' => null],
  21. 'created' => ['type' => 'date', 'null' => '1', 'default' => '', 'length' => ''],
  22. 'updated' => ['type' => 'datetime', 'null' => '1', 'default' => '', 'length' => null],
  23. 'age' => ['type' => 'integer', 'null' => '', 'default' => '', 'length' => null],
  24. '_constraints' => ['primary' => ['type' => 'primary', 'columns' => ['id']]],
  25. ]);
  26. }
  27. }