GroupsTable.php 822 B

123456789101112131415161718192021222324252627282930313233
  1. <?php
  2. /**
  3. * CakePHP(tm) Tests <http://book.cakephp.org/2.0/en/development/testing.html>
  4. * Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  5. *
  6. * Licensed under The MIT License
  7. * Redistributions of files must retain the above copyright notice
  8. *
  9. * @copyright Copyright (c) Cake Software Foundation, Inc. (http://cakefoundation.org)
  10. * @since 3.0.0
  11. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  12. */
  13. namespace TestApp\Model\Table;
  14. use Cake\ORM\Table;
  15. /**
  16. * Article table class
  17. *
  18. */
  19. class GroupsTable extends Table
  20. {
  21. public function initialize(array $config)
  22. {
  23. $this->belongsToMany('Members');
  24. $this->hasMany('GroupsMembers', [
  25. 'dependent' => true,
  26. 'cascadeCallbacks' => true
  27. ]);
  28. }
  29. }