mirror of https://github.com/MISP/MISP
chg: add all Event relationships
parent
c663661abb
commit
8040cf57a5
|
@ -18,6 +18,34 @@ class EventsTable extends AppTable
|
|||
parent::initialize($config);
|
||||
$this->addBehavior('AuditLog');
|
||||
|
||||
$this->belongsTo(
|
||||
'User',
|
||||
[
|
||||
'className' => 'Users',
|
||||
'foreignKey' => 'user_id'
|
||||
]
|
||||
);
|
||||
$this->belongsTo(
|
||||
'ThreatLevel',
|
||||
[
|
||||
'className' => 'ThreatLevels',
|
||||
'foreignKey' => 'threat_level_id'
|
||||
]
|
||||
);
|
||||
$this->belongsTo(
|
||||
'Org',
|
||||
[
|
||||
'className' => 'Organisations',
|
||||
'foreignKey' => 'org_id'
|
||||
]
|
||||
);
|
||||
$this->belongsTo(
|
||||
'Orgc',
|
||||
[
|
||||
'className' => 'Organisations',
|
||||
'foreignKey' => 'orgc_id'
|
||||
]
|
||||
);
|
||||
$this->belongsTo(
|
||||
'SharingGroup',
|
||||
[
|
||||
|
@ -25,6 +53,7 @@ class EventsTable extends AppTable
|
|||
'foreignKey' => 'sharing_group_id'
|
||||
]
|
||||
);
|
||||
|
||||
$this->hasMany(
|
||||
'Attributes',
|
||||
[
|
||||
|
@ -32,6 +61,53 @@ class EventsTable extends AppTable
|
|||
'propertyName' => 'Attribute'
|
||||
]
|
||||
);
|
||||
$this->hasMany(
|
||||
'ShadowAttributes',
|
||||
[
|
||||
'dependent' => true,
|
||||
'propertyName' => 'ShadowAttribute'
|
||||
]
|
||||
);
|
||||
$this->hasMany(
|
||||
'Objects',
|
||||
[
|
||||
'dependent' => true,
|
||||
'propertyName' => 'Object',
|
||||
'className' => 'MispObjects',
|
||||
]
|
||||
);
|
||||
$this->hasMany(
|
||||
'EventTags',
|
||||
[
|
||||
'dependent' => true,
|
||||
'propertyName' => 'EventTag',
|
||||
]
|
||||
);
|
||||
$this->hasMany(
|
||||
'Sightings',
|
||||
[
|
||||
'dependent' => true,
|
||||
'propertyName' => 'Sighting',
|
||||
]
|
||||
);
|
||||
$this->hasMany(
|
||||
'EventReports',
|
||||
[
|
||||
'dependent' => true,
|
||||
'propertyName' => 'EventReport',
|
||||
]
|
||||
);
|
||||
$this->hasMany(
|
||||
'CryptographicKeys',
|
||||
[
|
||||
'dependent' => true,
|
||||
'propertyName' => 'CryptographicKey',
|
||||
'foreignKey' => 'parent_id',
|
||||
'conditions' => [
|
||||
'parent_type' => 'Events'
|
||||
],
|
||||
]
|
||||
);
|
||||
$this->setDisplayField('title');
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue