Skip to content

Commit ff151d6

Browse files
authored
Merge pull request #303 from cakephp/3.x-fix-namepsace
fix SelectQuery namespace for Table policies
2 parents ed52f1a + 792dd58 commit ff151d6

File tree

4 files changed

+6
-6
lines changed

4 files changed

+6
-6
lines changed

src/Command/PolicyCommand.php

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -92,7 +92,7 @@ public function templateData(Arguments $arguments): array
9292
$className = $data['namespace'] . '\\' . $name;
9393
if ($type === 'table') {
9494
$className = "{$data['namespace']}\Model\\Table\\{$name}{$suffix}";
95-
$imports[] = 'Cake\ORM\SelectQuery';
95+
$imports[] = 'Cake\ORM\Query\SelectQuery';
9696
} elseif ($type === 'entity') {
9797
$className = "{$data['namespace']}\Model\\Entity\\{$name}";
9898
$imports[] = $className;

templates/bake/element/table_methods.twig

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
* Apply user access controls to a query for index actions
33
*
44
* @param \Authorization\IdentityInterface $user The user.
5-
* @param \Cake\ORM\SelectQuery $query The query to apply authorization conditions to.
5+
* @param \Cake\ORM\Query\SelectQuery $query The query to apply authorization conditions to.
66
* @return bool
77
*/
88
public function scopeIndex(IdentityInterface $user, SelectQuery $query): SelectQuery

tests/comparisons/BookmarksTablePolicy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace TestApp\Policy;
55

66
use Authorization\IdentityInterface;
7-
use Cake\ORM\SelectQuery;
7+
use Cake\ORM\Query\SelectQuery;
88

99
/**
1010
* Bookmarks policy
@@ -15,7 +15,7 @@ class BookmarksTablePolicy
1515
* Apply user access controls to a query for index actions
1616
*
1717
* @param \Authorization\IdentityInterface $user The user.
18-
* @param \Cake\ORM\SelectQuery $query The query to apply authorization conditions to.
18+
* @param \Cake\ORM\Query\SelectQuery $query The query to apply authorization conditions to.
1919
* @return bool
2020
*/
2121
public function scopeIndex(IdentityInterface $user, SelectQuery $query): SelectQuery

tests/comparisons/TestPluginUsersTablePolicy.php

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@
44
namespace TestPlugin\Policy;
55

66
use Authorization\IdentityInterface;
7-
use Cake\ORM\SelectQuery;
7+
use Cake\ORM\Query\SelectQuery;
88

99
/**
1010
* Users policy
@@ -15,7 +15,7 @@ class UsersTablePolicy
1515
* Apply user access controls to a query for index actions
1616
*
1717
* @param \Authorization\IdentityInterface $user The user.
18-
* @param \Cake\ORM\SelectQuery $query The query to apply authorization conditions to.
18+
* @param \Cake\ORM\Query\SelectQuery $query The query to apply authorization conditions to.
1919
* @return bool
2020
*/
2121
public function scopeIndex(IdentityInterface $user, SelectQuery $query): SelectQuery

0 commit comments

Comments
 (0)