2014-04-23 11:14:15 +08:00
|
|
|
<?php
|
|
|
|
App::uses('AppModel', 'Model');
|
|
|
|
/**
|
|
|
|
* Event Model
|
|
|
|
*
|
|
|
|
* @property Monitor $Monitor
|
|
|
|
* @property Frame $Frame
|
|
|
|
*/
|
|
|
|
class Event extends AppModel {
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Use table
|
|
|
|
*
|
|
|
|
* @var mixed False or table name
|
|
|
|
*/
|
|
|
|
public $useTable = 'Events';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Primary key field
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $primaryKey = 'Id';
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Display field
|
|
|
|
*
|
|
|
|
* @var string
|
|
|
|
*/
|
|
|
|
public $displayField = 'Name';
|
|
|
|
|
|
|
|
|
|
|
|
//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(
|
|
|
|
'Monitor' => array(
|
|
|
|
'className' => 'Monitor',
|
|
|
|
'foreignKey' => 'MonitorId',
|
|
|
|
'conditions' => '',
|
|
|
|
'fields' => '',
|
|
|
|
'order' => ''
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
|
|
|
/**
|
|
|
|
* hasMany associations
|
|
|
|
*
|
|
|
|
* @var array
|
|
|
|
*/
|
|
|
|
public $hasMany = array(
|
|
|
|
'Frame' => array(
|
|
|
|
'className' => 'Frame',
|
|
|
|
'foreignKey' => 'EventId',
|
2014-04-25 10:24:46 +08:00
|
|
|
'dependent' => true,
|
2014-04-23 11:14:15 +08:00
|
|
|
'conditions' => '',
|
|
|
|
'fields' => '',
|
|
|
|
'order' => '',
|
|
|
|
'limit' => '',
|
|
|
|
'offset' => '',
|
2015-10-01 03:53:23 +08:00
|
|
|
'exclusive' => 'true',
|
2014-04-23 11:14:15 +08:00
|
|
|
'finderQuery' => '',
|
|
|
|
'counterQuery' => ''
|
|
|
|
)
|
|
|
|
);
|
|
|
|
|
2017-12-05 04:52:16 +08:00
|
|
|
/**
|
|
|
|
* * * hasMany associations
|
|
|
|
* * *
|
|
|
|
* * * @var array
|
|
|
|
* * */
|
|
|
|
public $hasAndBelongsToMany = array(
|
|
|
|
'Group' => array(
|
|
|
|
'className' => 'Group',
|
|
|
|
'joinTable' => 'Groups_Monitors',
|
|
|
|
'foreignKey' => 'MonitorId',
|
2017-12-20 07:09:41 +08:00
|
|
|
'associationForeignKey' => 'MonitorId',
|
2017-12-05 04:52:16 +08:00
|
|
|
'unique' => true,
|
|
|
|
'dependent' => false,
|
2017-12-20 07:09:41 +08:00
|
|
|
'conditions' => '',
|
2017-12-05 04:52:16 +08:00
|
|
|
'fields' => '',
|
|
|
|
'order' => '',
|
|
|
|
'limit' => '',
|
|
|
|
'offset' => '',
|
|
|
|
'exclusive' => '',
|
|
|
|
'finderQuery' => '',
|
|
|
|
'counterQuery' => ''
|
|
|
|
),
|
|
|
|
);
|
|
|
|
|
2014-04-23 11:14:15 +08:00
|
|
|
}
|