mirror of https://github.com/MISP/MISP
Merge pull request #5952 from JakubOnderka/patch-107
fix: [internal] Remove unused methodpull/5958/head
commit
69f606a6c0
|
@ -5643,38 +5643,6 @@ class Event extends AppModel
|
|||
return $conditions;
|
||||
}
|
||||
|
||||
public function prepareEventForView()
|
||||
{
|
||||
// workaround to get the event dates in to the attribute relations
|
||||
$relatedDates = array();
|
||||
if (!empty($event['RelatedEvent'])) {
|
||||
foreach ($event['RelatedEvent'] as $relation) {
|
||||
$relatedDates[$relation['Event']['id']] = $relation['Event']['date'];
|
||||
}
|
||||
if (!empty($event['RelatedAttribute'])) {
|
||||
foreach ($event['RelatedAttribute'] as $key => $relatedAttribute) {
|
||||
foreach ($relatedAttribute as $key2 => $relation) {
|
||||
$event['RelatedAttribute'][$key][$key2]['date'] = $relatedDates[$relation['id']];
|
||||
}
|
||||
}
|
||||
}
|
||||
}
|
||||
$dataForView = array(
|
||||
'Attribute' => array('attrDescriptions', 'typeDefinitions', 'categoryDefinitions', 'distributionDescriptions', 'distributionLevels', 'shortDist'),
|
||||
'Event' => array('fieldDescriptions')
|
||||
);
|
||||
foreach ($dataForView as $m => $variables) {
|
||||
if ($m === 'Event') {
|
||||
$currentModel = $this;
|
||||
} elseif ($m === 'Attribute') {
|
||||
$currentModel = $this->Attribute;
|
||||
}
|
||||
foreach ($variables as $alias => $variable) {
|
||||
$this->set($alias, $currentModel->{$variable});
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
public function cacheSgids($user, $useCache = false)
|
||||
{
|
||||
if ($useCache && isset($this->__assetCache['sgids'])) {
|
||||
|
|
Loading…
Reference in New Issue