Merge pull request #3242 from connortechnology/fix_3232_api_monitor_event_summaries
Add Event_Summary model so that it is included in monitor listing
This commit is contained in:
parent
a4df8df5e5
commit
1abbc187e9
|
@ -0,0 +1,49 @@
|
|||
<?php
|
||||
App::uses('AppModel', 'Model');
|
||||
/**
|
||||
* Event_Summary Model
|
||||
*
|
||||
*/
|
||||
class Event_Summary extends AppModel {
|
||||
|
||||
/**
|
||||
* Use table
|
||||
*
|
||||
* @var mixed False or table name
|
||||
*/
|
||||
public $useTable = 'Event_Summaries';
|
||||
|
||||
/**
|
||||
* Primary key field
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $primaryKey = 'MonitorId';
|
||||
|
||||
/**
|
||||
* Display field
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
public $displayField = 'MonitorId';
|
||||
|
||||
public $recursive = -1;
|
||||
|
||||
/**
|
||||
* Validation rules
|
||||
*
|
||||
* @var array
|
||||
*/
|
||||
public $validate = array(
|
||||
'MonitorId' => 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
|
||||
),
|
||||
),
|
||||
);
|
||||
}
|
|
@ -134,6 +134,11 @@ class Monitor extends AppModel {
|
|||
'className' => 'Monitor_Status',
|
||||
'foreignKey' => 'MonitorId',
|
||||
'joinTable' => 'Monitor_Status',
|
||||
),
|
||||
'Event_Summary' => array(
|
||||
'className' => 'Event_Summary',
|
||||
'foreignKey' => 'MonitorId',
|
||||
'joinTable' => 'Event_Summaries',
|
||||
)
|
||||
);
|
||||
|
||||
|
|
Loading…
Reference in New Issue