2 class Profile extends AppModel {
6 var $profile_type = array(
37 'profile_type' => array(
52 'public_flag_default' => array(
57 'sort_order' => array(
64 var $validate = array(
66 'maxLengthJP' => array(
67 'rule' => array('maxLengthJP', 255),
77 'maxLengthJP' => array(
78 'rule' => array('maxLengthJP', 64),
84 'profile_type' => array(
85 'profileType' => array(
86 'rule' => 'profileType',
99 'public_flag_default' => array(
100 'publicFlag' => array(
101 'rule' => 'publicFlagDefault',
104 'sort_order' => array(
106 'rule' => array('numeric'),
107 'allowEmpty' => true,
112 //The Associations below have been created with all possible keys, those that are not needed can be removed
113 var $belongsTo = array(
115 'className' => 'System',
116 'foreignKey' => 'system_id',
118 'fields' => array('id', 'name'),
123 var $hasMany = array(
124 'ProfileSelect' => array(
125 'className' => 'ProfileSelect',
126 'foreignKey' => 'profile_id',
130 'order' => array('ProfileSelect.sort_order' => 'asc'),
137 'ProfileTable' => array(
138 'className' => 'ProfileTable',
139 'foreignKey' => 'profile_id',
143 'order' => array('ProfileTable.sort_order' => 'asc'),
150 'CharactersHasProfiles' => array(
151 'className' => 'CharactersHasProfiles',
152 'foreignKey' => 'profile_id',
153 'associationForeignKey' => 'id',
156 'fields' => array('id', 'value', 'public_flag'),
166 /* validation Rule */
168 /* 同システム中に同じkey_nameは不可 */
169 function isUniqueKeyname4system($data, $system_id, $id = null)
172 'conditions' => array(
173 'Profile.system_id' => $system_id,
174 'Profile.key_name' => $data['key_name'],
180 $params['conditions']['Profile.id !='] = $id;
183 return !($this->find('count', $params));
187 function profileType($data)
189 if (isset($data['profile_type']) && in_array($data['profile_type'], $this->profile_type)) {
196 function publicFlagDefault($data)
198 if (isset($data["public_flag_default"]) && in_array($data["public_flag_default"], $this->public_flag)) {