Add Event_Summary model so that it is included in monitor listing

This commit is contained in:
Isaac Connor 2021-05-18 11:12:37 -04:00
parent 50c0dddb10
commit 6350184346
2 changed files with 54 additions and 0 deletions

View File

@ -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
),
),
);
}

View File

@ -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',
)
);