Skip to content

Commit

Permalink
Add M17nBehavior comment for phpDocumentor
Browse files Browse the repository at this point in the history
  • Loading branch information
kteraguchi committed Nov 11, 2015
1 parent 192efc6 commit 8a28489
Showing 1 changed file with 28 additions and 0 deletions.
28 changes: 28 additions & 0 deletions Model/Behavior/M17nBehavior.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,34 @@
/**
* M17nBehavior
*
* 登録するコンテンツデータに対して、対応している言語分登録します。<br>
* 対応言語を運用途中で追加できません。
*
* コンテンツデータのテーブルに以下のフィールドを保持してください。
* * key
* 異なる言語で同一のデータが登録されます。
* * language_id
* 言語コードに対応するidが登録されます。
*
* コンテンツデータがbelongsToのアソシエーションを持ち、アソシエーション側でも言語ごとにデータがある場合は、
* 登録時に外部キーとしてのIDを取得するための情報を指定してください。<br>
* 指定内容は、外部キーのフィールド名、アソシエーションモデル名、ID取得条件です。
*
* #### サンプルコード
* ```
* public $actsAs = array(
* 'M17n.M17n' => array(
* 'associations' => array(
* 'faq_id' => array(
* 'className' => 'Faqs.Faq',
* ),
* 'category_id' => array(
* 'className' => 'Categories.Category',
* ),
* )
* ),
* ```
*
* @author Shohei Nakajima <nakajimashouhei@gmail.com>
* @package NetCommons\M17n\Model\Befavior
*/
Expand Down

0 comments on commit 8a28489

Please sign in to comment.