t('Environment Id'), 'endpoint_id' => t('Endpoint Id'), 'object_type' => t('Object Type'), 'host_id' => t('Host Id'), 'service_id' => t('Service Id'), 'start_time' => t('Flapping Start Time'), 'end_time' => t('Flapping End Time'), 'percent_state_change_start' => t('Flapping Percent State Change Start'), 'percent_state_change_end' => t('Flapping Percent State Change End'), 'flapping_threshold_low' => t('Flapping Threshold Low'), 'flapping_threshold_high' => t('Flapping Threshold High') ]; } public function createBehaviors(Behaviors $behaviors) { $behaviors->add(new MillisecondTimestamp([ 'start_time', 'end_time' ])); $behaviors->add(new Binary([ 'id', 'environment_id', 'endpoint_id', 'host_id', 'service_id' ])); } public function createRelations(Relations $relations) { $relations->belongsTo('endpoint', Endpoint::class); $relations->belongsTo('environment', Environment::class); $relations->belongsTo('history', History::class) ->setCandidateKey('id') ->setForeignKey('flapping_history_id'); $relations->belongsTo('host', Host::class); $relations->belongsTo('service', Service::class)->setJoinType('LEFT'); } }