Skip to content

Commit

Permalink
added counter cache to the content layouts
Browse files Browse the repository at this point in the history
  • Loading branch information
dogmatic69 committed Jan 17, 2010
1 parent 8c4103f commit 6d64be3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 3 deletions.
3 changes: 2 additions & 1 deletion infinitas/cms/controllers/contents_controller.php
Expand Up @@ -128,7 +128,8 @@ function admin_edit($id = null) {

$categories = array(__('Please select', true)) + $this->Content->Category->generatetreelist();
$groups = array(__('Public', true)) + $this->Content->Group->generatetreelist();
$this->set(compact('categories','groups'));
$layouts = $this->Content->Layout->find('list');
$this->set(compact('categories','groups','layouts'));
}
}

Expand Down
5 changes: 3 additions & 2 deletions infinitas/cms/models/content.php
Expand Up @@ -87,7 +87,8 @@ class Content extends CmsAppModel {
),
'Layout' => array(
'className' => 'Cms.ContentLayout',
'foreignKey' => 'layout_id'
'foreignKey' => 'layout_id',
'counterCache' => true
)
);

Expand All @@ -102,7 +103,7 @@ class Content extends CmsAppModel {
)
),
'Frontpage' => array(
'className' => 'Cms.ContentFrontpage',
'className' => 'Cms.Frontpage',
'fields' => array(
'Frontpage.id'
)
Expand Down

0 comments on commit 6d64be3

Please sign in to comment.