<?php
class Article extends AppModel {

  var $name = 'Article';

  var $validate = array(
    'name' => array(
      'unique' => array(
        'rule' => array('isUnique'),
        'on' => 'create',
        'message' => 'その識別名は既に登録されています。'
      ),
      'alphaNumeric' => array(
        'rule' => array('alphaNumeric'),
        'allowEmpty' => true,
        'message' => '識別名は半角英数字のみ有効です。'
      )
    ),
    'title' => array(
      'required' => array(
        'rule' => VALID_NOT_EMPTY,
        'allowEmpty' => false,
        'required' => true,
        'message' => 'タイトルを入力してください。'
      )
    )
  );

  var $belongsTo = array(
    'Category' => array(
      'className' => 'Category',
      'foreignKey' => 'category_id',
      'conditions' => '',
      'fields' => '',
      'order' => ''
      )
    );

  var $hasMany = array(
    'ArticleItem' => array(
      'className' => 'ArticleItem',
      'foreignKey' => 'article_id',
      'dependent' => true,
      'conditions' => '',
      'fields' => '',
      'order' => '',
      'limit' => '',
      'offset' => '',
      'exclusive' => '',
      'finderQuery' => '',
      'counterQuery' => ''
    )
  );

}
?>