/**
* A CruncherTestUnit producer class
*
- * @author Roland Haeder <webmaster@ship-simu.org>
+ * @author Roland Haeder <webmaster@shipsimu.org>
* @version 0.0.0
- * @copyright Copyright (c) 2011 - 2012 Cruncher Developer Team
+ * @copyright Copyright (c) 2011 - 2014 Cruncher Developer Team
* @license GNU GPL 3.0 or any newer version
- * @link http://www.ship-simu.org
+ * @link http://www.shipsimu.org
*
* This program is free software: you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
* @return void
* @todo ~60% done
*/
- public function prepareUnitProduction (Stateable $stateInstance) {
+ public function initUnitProduction (Stateable $stateInstance) {
// First get a database wrapper because we want to permanently store test units
- $wrapperInstance = ObjectFactory::createObjectByConfiguredName('cruncher_unit_db_wrapper_class');
-
- // Now get a search instance
- $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
-
- // Add criteria for looking up already created and available test units
- $searchInstance->addCriteria(CruncherUnitDatabaseWrapper::DB_COLUMN_UNIT_TYPE , BaseUnitProducer::UNIT_TYPE_TEST_UNIT);
- $searchInstance->addCriteria(CruncherUnitDatabaseWrapper::DB_COLUMN_UNIT_STATUS, BaseUnitProducer::UNIT_STATUS_AVAILABLE);
- $searchInstance->setConfiguredLimit('cruncher_test_unit_max_count');
-
- // Search for our units
- $resultInstance = $wrapperInstance->doSelectByCriteria($searchInstance);
+ $wrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName('cruncher_unit_db_wrapper_class');
// Do we have some entries?
- if ($resultInstance->next()) {
+ if ($wrapperInstance->isTestUnitProduced()) {
// Entries found
// @TODO Unfinished work here
$this->debugInstance();
$stateInstance->encryptedMessageGenerated();
}
}
+
+ /**
+ * Initializes the executor, whatever it does.
+ *
+ * @return void
+ * @todo Maybe unfinished
+ */
+ public function initExecutor (Stateable $stateInstance) {
+ $this->partialStub('Maybe implement this method?');
+ }
}
// [EOF]