TestAuthComponent.php 1.3 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  4. * Copyright 2005-2011, 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 2005-2011, Cake Software Foundation, Inc. (http://cakefoundation.org)
  10. * @link http://cakephp.org CakePHP(tm) Project
  11. * @since 3.0.0
  12. * @license http://www.opensource.org/licenses/mit-license.php MIT License
  13. */
  14. namespace TestApp\Controller\Component;
  15. use Cake\Controller\Component\AuthComponent;
  16. /**
  17. * TestAuthComponent class
  18. *
  19. */
  20. class TestAuthComponent extends AuthComponent {
  21. /**
  22. * Helper method to add/set an authenticate object instance
  23. *
  24. * @param int $index The index at which to add/set the object
  25. * @param Object $object The object to add/set
  26. * @return void
  27. */
  28. public function setAuthenticateObject($index, $object) {
  29. $this->_authenticateObjects[$index] = $object;
  30. }
  31. /**
  32. * Helper method to add/set an authorize object instance
  33. *
  34. * @param int $index The index at which to add/set the object
  35. * @param Object $object The object to add/set
  36. * @return void
  37. */
  38. public function setAuthorizeObject($index, $object) {
  39. $this->_authorizeObjects[$index] = $object;
  40. }
  41. }