PublishedPostsTable.php 843 B

1234567891011121314151617181920212223242526272829303132
  1. <?php
  2. declare(strict_types=1);
  3. /**
  4. * Test App Posts Model
  5. *
  6. * CakePHP : Rapid Development Framework (https://cakephp.org)
  7. * Copyright 2005-2012, Cake Software Foundation, Inc.
  8. *
  9. * Licensed under The MIT License
  10. * Redistributions of files must retain the above copyright notice.
  11. *
  12. * @copyright Copyright 2005-2012, Cake Software Foundation, Inc.
  13. * @link https://cakephp.org CakePHP Project
  14. * @since 3.0.0
  15. * @license https://opensource.org/licenses/mit-license.php MIT License
  16. */
  17. namespace TestApp\Model\Table;
  18. use Cake\Database\Query;
  19. use Cake\ORM\Table;
  20. /**
  21. * Used for testing counter cache with custom finder
  22. */
  23. class PublishedPostsTable extends Table
  24. {
  25. public function findPublished(Query $query, array $options = []): Query
  26. {
  27. return $query->where(['published' => true]);
  28. }
  29. }