98 lines
1.9 KiB
PHP
98 lines
1.9 KiB
PHP
|
<?php
|
||
|
App::uses('AppModel', 'Model');
|
||
|
/**
|
||
|
* MicDjPageTxt Model
|
||
|
*
|
||
|
* @property PagePtr $PagePtr
|
||
|
*/
|
||
|
class DreamjobPageText extends AppModel {
|
||
|
|
||
|
/**
|
||
|
* Use database config
|
||
|
*
|
||
|
* @var string
|
||
|
*/
|
||
|
public $useDbConfig = 'dreamjobMain';
|
||
|
|
||
|
/**
|
||
|
* Use table
|
||
|
*
|
||
|
* @var mixed False or table name
|
||
|
*/
|
||
|
public $useTable = 'mic_dj_page_txt';
|
||
|
|
||
|
/**
|
||
|
* Primary key field
|
||
|
*
|
||
|
* @var string
|
||
|
*/
|
||
|
public $primaryKey = 'page_ptr_id';
|
||
|
|
||
|
/**
|
||
|
* Display field
|
||
|
*
|
||
|
* @var string
|
||
|
*/
|
||
|
public $displayField = 'page_ptr_id';
|
||
|
|
||
|
/**
|
||
|
* Validation rules
|
||
|
*
|
||
|
* @var array
|
||
|
*/
|
||
|
public function delete($id = NULL, $cascade = false){
|
||
|
$dataSource = $this->getDataSource();
|
||
|
$dataSource->begin();
|
||
|
|
||
|
$result = parent::delete($id,$cascade);
|
||
|
if($result){
|
||
|
$result = $this->DreamjobPageInh->delete($id,$cascade);
|
||
|
}
|
||
|
if ($result) {
|
||
|
$dataSource->commit();
|
||
|
return true;
|
||
|
} else {
|
||
|
$dataSource->rollback();
|
||
|
}
|
||
|
return false;
|
||
|
}
|
||
|
public $validate = array(
|
||
|
'page_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
|
||
|
),
|
||
|
),
|
||
|
// 'text' => array(),
|
||
|
);
|
||
|
|
||
|
//The Associations below have been created with all possible keys, those that are not needed can be removed
|
||
|
|
||
|
/**
|
||
|
* belongsTo associations
|
||
|
*
|
||
|
* @var array
|
||
|
*/
|
||
|
public $belongsTo = array(
|
||
|
'DreamjobPageInh' => array(
|
||
|
'className' => 'DreamjobPageInh',
|
||
|
'foreignKey' => 'page_ptr_id',
|
||
|
'conditions' => '',
|
||
|
'fields' => '',
|
||
|
'order' => ''
|
||
|
)
|
||
|
);
|
||
|
}
|