mirror of https://github.com/MISP/MISP
chg: [decaying] Improved coverage of model overrides to the API
parent
8d8526977d
commit
0e00413259
|
@ -17,6 +17,7 @@ class DecayingModel extends AppModel
|
|||
);
|
||||
|
||||
private $__registered_model_classes = array();
|
||||
public $allowed_overrides = array('threshold' => 1, 'tau', 'delta');
|
||||
|
||||
public function afterFind($results, $primary = false) {
|
||||
foreach ($results as $k => $v) {
|
||||
|
@ -438,9 +439,8 @@ class DecayingModel extends AppModel
|
|||
|
||||
public function overrideModelParameters(&$model, $model_overrides)
|
||||
{
|
||||
$allowed_overrides = array('threshold' => 1);
|
||||
foreach ($model_overrides as $parameter => $value) {
|
||||
if (isset($allowed_overrides[$parameter])) {
|
||||
if (isset($this->allowed_overrides[$parameter])) {
|
||||
$model['DecayingModel']['parameters'][$parameter] = $value;
|
||||
}
|
||||
}
|
||||
|
|
|
@ -31,11 +31,13 @@
|
|||
{
|
||||
"includeDecayScore": 1,
|
||||
"excludeDecayed": 0,
|
||||
"decayingModel": <?php echo h($decaying_model['DecayingModel']['id']); ?>,
|
||||
"decayingModel": [<?php echo h($decaying_model['DecayingModel']['id']); ?>],
|
||||
"to_ids": 1,
|
||||
"org": <?php echo h($user['Organisation']['id']);?>,
|
||||
"tags": <?php echo json_encode($registered_taxonomies); ?>
|
||||
"tags": <?php echo json_encode($registered_taxonomies); ?>,
|
||||
"modelOverrides": {
|
||||
|
||||
}
|
||||
}</textarea>
|
||||
</br>
|
||||
<span class="btn btn-primary" style="width: fit-content;" role="button" onclick="doRestSearch(this)"><?php echo __('Search'); ?></span>
|
||||
|
|
Loading…
Reference in New Issue