ソースを参照

Add ObjectRegistry::has().

It allows checking if a particular object is loaded.
ADmad 11 年 前
コミット
61e1057925
1 ファイル変更10 行追加0 行削除
  1. 10 0
      src/Core/ObjectRegistry.php

+ 10 - 0
src/Core/ObjectRegistry.php

@@ -168,6 +168,16 @@ abstract class ObjectRegistry {
 	}
 
 /**
+ * Check whether or not a given object is loaded.
+ *
+ * @param string $name The object name to check for.
+ * @return bool True is object is loaded else false.
+ */
+	public function has($name) {
+		return isset($this->_loaded[$name]);
+	}
+
+/**
  * Provide public read access to the loaded objects
  *
  * @param string $name Name of property to read