Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

Merge pull request #381 from andreaskri/counterCache_examples_fix

Correct relations in examples for counterCache
  • Loading branch information...
commit 65a1652b8e8ee686c0286feccf274747a59ba83a 2 parents 8592b6c + 6f4f120
@lorenzo lorenzo authored
View
8 en/models/associations-linking-models-together.rst
@@ -536,9 +536,9 @@ counter-cache in your association by adding a ``counterCache`` key
and set the value to ``true``::
<?php
- class Image extends AppModel {
+ class ImageComment extends AppModel {
public $belongsTo = array(
- 'ImageComment' => array(
+ 'Image' => array(
'counterCache' => true,
)
);
@@ -555,9 +555,9 @@ to, depending on how you look at it) the counter value.
Using our Image model example, we can specify it like so::
<?php
- class Image extends AppModel {
+ class ImageComment extends AppModel {
public $belongsTo = array(
- 'ImageComment' => array(
+ 'Image' => array(
'counterCache' => true,
'counterScope' => array('Image.active' => 1) // only count if "Image" is active = 1
)
View
8 fr/models/associations-linking-models-together.rst
@@ -542,9 +542,9 @@ counter-cache in your association by adding a ``counterCache`` key
and set the value to ``true``::
<?php
- class Image extends AppModel {
+ class ImageComment extends AppModel {
public $belongsTo = array(
- 'ImageComment' => array(
+ 'Image' => array(
'counterCache' => true,
)
);
@@ -561,9 +561,9 @@ to, depending on how you look at it) the counter value.
Using our Image model example, we can specify it like so::
<?php
- class Image extends AppModel {
+ class ImageComment extends AppModel {
public $belongsTo = array(
- 'ImageComment' => array(
+ 'Image' => array(
'counterCache' => true,
'counterScope' => array('Image.active' => 1) // only count if "Image" is active = 1
)
View
8 ja/models/associations-linking-models-together.rst
@@ -514,9 +514,9 @@ counter-cache機能を有効にするためにアソシエーションの設定
``counterCache`` キーに ``true`` をセットしましょう。 ::
<?php
- class Image extends AppModel {
+ class ImageComment extends AppModel {
public $belongsTo = array(
- 'ImageComment' => array(
+ 'Image' => array(
'counterCache' => true,
)
);
@@ -532,9 +532,9 @@ counter-cache機能を有効にするためにアソシエーションの設定
Imageモデルのサンプルでは、次のようになるでしょう。 ::
<?php
- class Image extends AppModel {
+ class ImageComment extends AppModel {
public $belongsTo = array(
- 'ImageComment' => array(
+ 'Image' => array(
'counterCache' => true,
'counterScope' => array('Image.active' => 1) // "Image" が active なデータのみカウントします
)
Please sign in to comment.
Something went wrong with that request. Please try again.