Skip to content

Commit e8a2986

Browse files
committed
Update readme
1 parent bda3d87 commit e8a2986

1 file changed

Lines changed: 6 additions & 6 deletions

File tree

README.md

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -12,13 +12,13 @@ Allows setting default order for your tables.
1212

1313
Using [Composer][composer]:
1414

15-
```
15+
```sh
1616
composer require muffin/orderly
1717
```
1818

1919
Then load the plugin using the console command:
2020

21-
```
21+
```sh
2222
bin/cake plugin load Muffin/Orderly
2323
```
2424

@@ -38,7 +38,7 @@ $this->addBehavior('Muffin/Orderly.Orderly');
3838
$this->addBehavior('Muffin/Orderly.Orderly', ['order' => $this->aliasField('field_name')]);
3939
```
4040

41-
Value for `order` key can any valid value that `\Cake\ORM\Query::orderBy()` takes.
41+
Value for `order` key can any valid value that `\Cake\ORM\Query\SelectQuery::orderBy()` takes.
4242
The default order clause will only be applied to the primary query and when no
4343
custom order clause has already been set for the query.
4444

@@ -48,7 +48,7 @@ condition using `callback` option. The order will be applied if callback returns
4848
```php
4949
$this->addBehavior('Muffin/Orderly.Orderly', [
5050
'order' => ['Alias.field_name' => 'DESC'],
51-
'callback' => function (\Cake\ORM\Query $query, \ArrayObject $options, bool $primary) {
51+
'callback' => function (SelectQuery $query, ArrayObject $options, bool $primary) {
5252
//return a boolean
5353
}
5454
]);
@@ -61,13 +61,13 @@ on return value of their respective callbacks:
6161
$this->addBehavior('Muffin/Orderly.Orderly', [
6262
[
6363
'order' => ['Alias.field_name' => 'DESC'],
64-
'callback' => function (\Cake\ORM\Query $query, \ArrayObject $options, bool $primary) {
64+
'callback' => function (SelectQuery $query, ArrayObject $options, bool $primary) {
6565
//return a boolean
6666
}
6767
],
6868
[
6969
'order' => ['Alias.another_field'],
70-
'callback' => function (\Cake\ORM\Query $query, \ArrayObject $options, bool $primary) {
70+
'callback' => function (SelectQuery $query, ArrayObject $options, bool $primary) {
7171
//return a boolean
7272
}
7373
],

0 commit comments

Comments
 (0)