dreamjob/app/Model/DreamjobWorker.php

174 lines
4.5 KiB
PHP
Executable File

<?php
App::uses('AppModel', 'Model');
/**
* DreamjobWorker Model
*
* TODO
*
* @property DjaccountPtr $DjaccountPtr
* @property Graducation $Graducation
*/
class DreamjobWorker extends AppModel {
/**
* Use database config
*
* @var string
*/
public $useDbConfig = 'dreamjobMain';
/**
* Use table
*
* @var mixed False or table name
*/
public $useTable = 'mic_dj_account_wrk';
/**
* Primary key field
*
* @var string
*/
public $primaryKey = 'djaccount_ptr_id';
/**
* Display field
*
* @var string
*/
public $displayField = 'djaccount_ptr_id';
/**
* Validation rules
*
* @var array
*/
public $validate = array(
'djaccount_ptr_id' => array(
'numeric' => array(
'rule' => array('numeric'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
'multiple' => array(
'rule' => array('multiple'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
'notEmpty' => array(
'rule' => array('notEmpty'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'searchhidden' => array(
'boolean' => array(
'rule' => array('boolean'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'advertising' => array(
'boolean' => array(
'rule' => array('boolean'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'leadership_ability' => array(
'boolean' => array(
'rule' => array('boolean'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'country' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
'iam' => array(
'notEmpty' => array(
'rule' => array('notEmpty'),
//'message' => 'Your custom message here',
//'allowEmpty' => false,
//'required' => false,
//'last' => false, // Stop validation after this rule
//'on' => 'create', // Limit validation to 'create' or 'update' operations
),
),
);
public $hasAndBelongsToMany = array(
'User' =>array(
'className' => 'User',
'with' => 'AppUser',
'foreignKey' => 'id',
'associationForeignKey' => 'user_id',
'limit' => 1
),
'Favority' => array(
'className' => 'DreamjobJobOpening',
'with' => 'DreamjobJobFavority',
//'joinTable' => 'mic_dj_job_opening_worker',
'foreignKey' => 'worker_id',
'associationForeignKey' => 'opening_id'
)
);
public $belongsTo = array(
'DreamjobListGraducation' => array(
'className' => 'DreamjobListGraducation',
'foreignKey' => 'graducation_id'
)
);
public $hasOne = array(
'DreamjobUser' => array(
'className' => 'DreamjobUser',
'foreignKey' => 'micapplication_ptr_id'
),
'AppUser' => array(
'className' => 'AppUser',
'foreignKey' => 'id'
),
'User' => array(
'className' => 'User',
'foreignKey' => false,
'conditions' => array('DreamjobWorker.djaccount_ptr_id=AppUser.id and User.id = AppUser.user_id'),
'limit' => 1
)
);
public $hasMany = array(
'DreamjobPageInh' => array(
'className' => 'DreamjobPageInh',
'foreignKey' => 'user_id'
),
'DreamjobJobApplication' => array(
'className' => 'DreamjobJobApplication',
'foreignKey' => 'worker_id'
)
);
}