Skip to content

Commit 3425c7a

Browse files
author
James Watts
committed
Added method to determine if the factory has the specified object
1 parent 02fd109 commit 3425c7a

File tree

1 file changed

+12
-0
lines changed

1 file changed

+12
-0
lines changed

Lib/CtkFactory.php

+12
Original file line numberDiff line numberDiff line change
@@ -220,6 +220,18 @@ final public function getPlugin() {
220220
return $this->_plugin;
221221
}
222222

223+
/**
224+
* Determines if the factory has the specified object.
225+
*
226+
* @param string $name Name of object to search for.
227+
* @return boolean
228+
*/
229+
final public function hasObject($name) {
230+
$class = $this->_name . $name;
231+
App::uses($class, ((!empty($this->_plugin))? $this->_plugin . '.' : '') . 'View/Factory/' . $this->_name . '/Objects/');
232+
return class_exists($class);
233+
}
234+
223235
/**
224236
* Abstract method used to setup additional resources for the factory.
225237
*

0 commit comments

Comments
 (0)