96 lines
1.7 KiB
PHP
96 lines
1.7 KiB
PHP
<?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',
|
|
'dependent' => true,
|
|
'conditions' => '',
|
|
'fields' => '',
|
|
'order' => '',
|
|
'limit' => '',
|
|
'offset' => '',
|
|
'exclusive' => 'true',
|
|
'finderQuery' => '',
|
|
'counterQuery' => ''
|
|
)
|
|
);
|
|
|
|
/**
|
|
* * * hasMany associations
|
|
* * *
|
|
* * * @var array
|
|
* * */
|
|
public $hasAndBelongsToMany = array(
|
|
'Group' => array(
|
|
'className' => 'Group',
|
|
'joinTable' => 'Groups_Monitors',
|
|
'foreignKey' => 'MonitorId',
|
|
'associationForeignKey' => 'MonitorId',
|
|
'unique' => true,
|
|
'dependent' => false,
|
|
'conditions' => '',
|
|
'fields' => '',
|
|
'order' => '',
|
|
'limit' => '',
|
|
'offset' => '',
|
|
'exclusive' => '',
|
|
'finderQuery' => '',
|
|
'counterQuery' => ''
|
|
),
|
|
);
|
|
|
|
}
|