AuthUsersTable.php 1.0 KB

1234567891011121314151617181920212223242526272829303132333435363738394041
  1. <?php
  2. /**
  3. * CakePHP(tm) : Rapid Development Framework (http://cakephp.org)
  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\Query;
  15. use Cake\ORM\Table;
  16. /**
  17. * AuthUser class
  18. *
  19. */
  20. class AuthUsersTable extends Table
  21. {
  22. /**
  23. * Custom finder
  24. *
  25. * @param \Cake\ORM\Query $query The query to find with
  26. * @param array $options The options to find with
  27. * @return \Cake\ORM\Query The query builder
  28. */
  29. public function findAuth(Query $query, array $options)
  30. {
  31. $query->select(['id', 'username', 'password']);
  32. if (!empty($options['return_created'])) {
  33. $query->select(['created']);
  34. }
  35. return $query;
  36. }
  37. }