[icinga-checkins] icinga.org: icinga-api/mhein/default: * Command object instance method

git at icinga.org git at icinga.org
Tue Jul 27 14:31:33 CEST 2010


Module: icinga-api
Branch: mhein/default
Commit: 7b94f24746e959029258e8d29999e0ab6840ec4a
URL:    https://git.icinga.org/?p=icinga-api.git;a=commit;h=7b94f24746e959029258e8d29999e0ab6840ec4a

Author: Marius Hein <marius.hein at netways.de>
Date:   Tue Jul 27 14:30:58 2010 +0200

* Command object instance method
* Fix for exception inheritance

---

 objects/command/IcingaApiCommand.php           |   13 +++++++++++++
 objects/command/IcingaApiCommandDispatcher.php |    2 +-
 2 files changed, 14 insertions(+), 1 deletions(-)

diff --git a/objects/command/IcingaApiCommand.php b/objects/command/IcingaApiCommand.php
index 021e704..c0081f3 100644
--- a/objects/command/IcingaApiCommand.php
+++ b/objects/command/IcingaApiCommand.php
@@ -144,6 +144,19 @@ class IcingaApiCommand
 	}
 
 	/**
+	 * Return the target instance of the command
+	 * @return string
+	 * @author Marius Hein <marius.hein at netways.de>
+	 */
+	public function getCommandInstance() {
+		if (isset($this->config['target'][self::COMMAND_INSTANCE])) {
+			return $this->config['target'][self::COMMAND_INSTANCE];
+		}
+
+		return null;
+	}
+
+	/**
 	 * checks fields (command parameter values)
 	 * @param	void
 	 * @return	boolean								true if fields are ok otherwise false
diff --git a/objects/command/IcingaApiCommandDispatcher.php b/objects/command/IcingaApiCommandDispatcher.php
index efa946b..e9a84e7 100644
--- a/objects/command/IcingaApiCommandDispatcher.php
+++ b/objects/command/IcingaApiCommandDispatcher.php
@@ -111,6 +111,6 @@ class IcingaApiCommandDispatcher
 }
 
 // class exceptions
-class IcingaApiCommandDispatcherException extends IcingaApiCommand {}
+class IcingaApiCommandDispatcherException extends IcingaApiCommandException {}
 
 ?>
\ No newline at end of file





More information about the icinga-checkins mailing list