MODEL.php 2.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102
  1. <?php
  2. use Baum\Node;
  3. /**
  4. * MODEL
  5. */
  6. class MODEL extends Node {
  7. /**
  8. * Table name.
  9. *
  10. * @var string
  11. */
  12. protected $table = 'm_o_d_e_l_s';
  13. //////////////////////////////////////////////////////////////////////////////
  14. //
  15. // Below come the default values for Baum's own Nested Set implementation
  16. // column names.
  17. //
  18. // You may uncomment and modify the following fields at your own will, provided
  19. // they match *exactly* those provided in the migration.
  20. //
  21. // If you don't plan on modifying any of these you can safely remove them.
  22. //
  23. // /**
  24. // * Column name which stores reference to parent's node.
  25. // *
  26. // * @var string
  27. // */
  28. // protected $parentColumn = 'parent_id';
  29. // /**
  30. // * Column name for the left index.
  31. // *
  32. // * @var string
  33. // */
  34. // protected $leftColumn = 'lft';
  35. // /**
  36. // * Column name for the right index.
  37. // *
  38. // * @var string
  39. // */
  40. // protected $rightColumn = 'rgt';
  41. // /**
  42. // * Column name for the depth field.
  43. // *
  44. // * @var string
  45. // */
  46. // protected $depthColumn = 'depth';
  47. // /**
  48. // * Column to perform the default sorting
  49. // *
  50. // * @var string
  51. // */
  52. // protected $orderColumn = null;
  53. // /**
  54. // * With Baum, all NestedSet-related fields are guarded from mass-assignment
  55. // * by default.
  56. // *
  57. // * @var array
  58. // */
  59. // protected $guarded = array('id', 'parent_id', 'lft', 'rgt', 'depth');
  60. //
  61. // This is to support "scoping" which may allow to have multiple nested
  62. // set trees in the same database table.
  63. //
  64. // You should provide here the column names which should restrict Nested
  65. // Set queries. f.ex: company_id, etc.
  66. //
  67. // /**
  68. // * Columns which restrict what we consider our Nested Set list
  69. // *
  70. // * @var array
  71. // */
  72. // protected $scoped = array();
  73. //////////////////////////////////////////////////////////////////////////////
  74. //
  75. // Baum makes available two model events to application developers:
  76. //
  77. // 1. `moving`: fired *before* the a node movement operation is performed.
  78. //
  79. // 2. `moved`: fired *after* a node movement operation has been performed.
  80. //
  81. // In the same way as Eloquent's model events, returning false from the
  82. // `moving` event handler will halt the operation.
  83. //
  84. // Please refer the Laravel documentation for further instructions on how
  85. // to hook your own callbacks/observers into this events:
  86. // http://laravel.com/docs/5.0/eloquent#model-events
  87. }