This repository was archived by the owner on Jan 3, 2024. It is now read-only.
File tree Expand file tree Collapse file tree 2 files changed +7
-9
lines changed
Expand file tree Collapse file tree 2 files changed +7
-9
lines changed Original file line number Diff line number Diff line change 1111 $query->contain([<%= $this->Bake->stringifyList($belongsTo, ['indent' => false]) %>]);
1212<% endif; %>
1313
14- if (empty($this->request->getQuery('sort'))) {
15- $query->order([$this-><%= $currentModelName %>->aliasField('modified') => 'desc']);
16- }
17-
18- $this->set('<%= $pluralName %>', $this->paginate($query));
14+ $this->set('<%= $pluralName %>', $this->paginate($query, [
15+ 'order' => [$this-><%= $currentModelName %>->aliasField('modified') => 'desc']
16+ ));
1917 }
Original file line number Diff line number Diff line change @@ -41,16 +41,16 @@ class <%= $name %>Table extends Table
4141 public function initialize (array $ config )
4242 {
4343<% if (!empty ($ table )): %>
44- $ this ->table ('<%= $table %> ' );
44+ $ this ->setTable ('<%= $table %> ' );
4545<% endif %>
4646<% if (!empty ($ displayField )): %>
47- $ this ->displayField ('<%= $displayField %> ' );
47+ $ this ->setDisplayField ('<%= $displayField %> ' );
4848<% endif %>
4949<% if (!empty ($ primaryKey )): %>
5050<% if (count ($ primaryKey ) > 1 ): %>
51- $ this ->primaryKey ([<%= $ this ->Bake ->stringifyList ((array )$ primaryKey , ['indent ' => false ]) %>]);
51+ $ this ->setPrimaryKey ([<%= $ this ->Bake ->stringifyList ((array )$ primaryKey , ['indent ' => false ]) %>]);
5252<% else : %>
53- $ this ->primaryKey ('<%= current((array)$primaryKey) %> ' );
53+ $ this ->setPrimaryKey ('<%= current((array)$primaryKey) %> ' );
5454<% endif %>
5555<% endif %>
5656
You can’t perform that action at this time.
0 commit comments