OrdersFixture.php 1.8 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (https://cakephp.org)
  4. * Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * For full copyright and license information, please see the LICENSE.txt
  8. * Redistributions of files must retain the above copyright notice
  9. *
  10. * @copyright Copyright (c) Cake Software Foundation, Inc. (https://cakefoundation.org)
  11. * @link https://cakephp.org CakePHP(tm) Project
  12. * @since 3.0.7
  13. * @license https://opensource.org/licenses/mit-license.php MIT License
  14. */
  15. namespace Cake\Test\Fixture;
  16. use Cake\TestSuite\Fixture\TestFixture;
  17. /**
  18. * OrdersFixture
  19. */
  20. class OrdersFixture extends TestFixture
  21. {
  22. /**
  23. * {@inheritDoc}
  24. */
  25. public $table = 'orders';
  26. /**
  27. * fields property
  28. *
  29. * @var array
  30. */
  31. public $fields = [
  32. 'id' => ['type' => 'integer'],
  33. 'product_category' => ['type' => 'integer', 'null' => false],
  34. 'product_id' => ['type' => 'integer', 'null' => false],
  35. '_indexes' => [
  36. 'product_category' => [
  37. 'type' => 'index',
  38. 'columns' => ['product_category', 'product_id']
  39. ]
  40. ],
  41. '_constraints' => [
  42. 'primary' => [
  43. 'type' => 'primary', 'columns' => ['id']
  44. ],
  45. 'product_category_fk' => [
  46. 'type' => 'foreign',
  47. 'columns' => ['product_category', 'product_id'],
  48. 'references' => ['products', ['category', 'id']],
  49. 'update' => 'cascade',
  50. 'delete' => 'cascade',
  51. ]
  52. ]
  53. ];
  54. /**
  55. * records property
  56. *
  57. * @var array
  58. */
  59. public $records = [
  60. ['product_category' => 1, 'product_id' => 1]
  61. ];
  62. }