From b18bc644404e02b57635bfcc8258e85abb141146 Mon Sep 17 00:00:00 2001 From: Daniel Baumann Date: Sat, 13 Apr 2024 13:44:46 +0200 Subject: Adding upstream version 1.1.1. Signed-off-by: Daniel Baumann --- library/Icingadb/Model/Endpoint.php | 69 +++++++++++++++++++++++++++++++++++++ 1 file changed, 69 insertions(+) create mode 100644 library/Icingadb/Model/Endpoint.php (limited to 'library/Icingadb/Model/Endpoint.php') diff --git a/library/Icingadb/Model/Endpoint.php b/library/Icingadb/Model/Endpoint.php new file mode 100644 index 0000000..257001b --- /dev/null +++ b/library/Icingadb/Model/Endpoint.php @@ -0,0 +1,69 @@ + t('Environment Id'), + 'name_checksum' => t('Endpoint Name Checksum'), + 'properties_checksum' => t('Endpoint Properties Checksum'), + 'name' => t('Endpoint Name'), + 'name_ci' => t('Endpoint Name (CI)'), + 'zone_id' => t('Zone Id') + ]; + } + + public function createBehaviors(Behaviors $behaviors) + { + $behaviors->add(new Binary([ + 'id', + 'environment_id', + 'name_checksum', + 'properties_checksum', + 'zone_id' + ])); + } + + public function createRelations(Relations $relations) + { + $relations->belongsTo('environment', Environment::class); + $relations->belongsTo('zone', Zone::class); + + $relations->hasMany('host', Host::class) + ->setForeignKey('command_endpoint_id'); + $relations->hasMany('service', Service::class) + ->setForeignKey('command_endpoint_id'); + } +} -- cgit v1.2.3