/**
* Framework/application paths for classes, etc.
*/
- private static $frameworkPaths = array(
+ private static $frameworkPaths = [
+ 'classes', // Classes
'exceptions', // Exceptions
'interfaces', // Interfaces
- 'classes', // Classes
- 'middleware' // The middleware
- );
+ 'middleware', // The middleware
+ 'traits', // Traits
+ ];
/**
* Registered paths where test classes can be found. These are all relative
// Import framework stuff
use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap;
use Org\Mxchange\CoreFramework\Criteria\Criteria;
-use Org\Mxchange\CoreFramework\Crypto\Cryptable;
use Org\Mxchange\CoreFramework\Database\Frontend\DatabaseWrapper;
use Org\Mxchange\CoreFramework\EntryPoint\ApplicationEntryPoint;
use Org\Mxchange\CoreFramework\Factory\Database\Wrapper\DatabaseWrapperFactory;
use Org\Mxchange\CoreFramework\Middleware\Debug\DebugMiddleware;
use Org\Mxchange\CoreFramework\Registry\GenericRegistry;
use Org\Mxchange\CoreFramework\Result\Database\CachedDatabaseResult;
-use Org\Mxchange\CoreFramework\Result\Search\SearchableResult;
use Org\Mxchange\CoreFramework\State\Stateable;
use Org\Mxchange\CoreFramework\Stream\Input\InputStream;
use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
use Org\Mxchange\CoreFramework\Stream\Output\OutputStream;
-use Org\Mxchange\CoreFramework\User\ManageableAccount;
use Org\Mxchange\CoreFramework\Utils\String\StringUtils;
// Import SPL stuff
*/
private $realClass = __CLASS__;
- /**
- * Database result instance
- */
- private $resultInstance = NULL;
-
- /**
- * Instance for user class
- */
- private $userInstance = NULL;
-
- /**
- * Instance of a crypto helper
- */
- private $cryptoInstance = NULL;
-
/**
* Instance of an Iterator class
*/
* @return void
*/
public function __destruct () {
- // Flush any updated entries to the database
- $this->flushPendingUpdates();
-
// Is this object already destroyed?
if ($this->__toString() != 'DestructedObject') {
// Destroy all informations about this class but keep some text about it alive
$this->realClass = $realClass;
}
- /**
- * Setter for database result instance
- *
- * @param $resultInstance An instance of a database result class
- * @return void
- * @todo SearchableResult and UpdateableResult shall have a super interface to use here
- */
- protected final function setResultInstance (SearchableResult $resultInstance) {
- $this->resultInstance = $resultInstance;
- }
-
- /**
- * Getter for database result instance
- *
- * @return $resultInstance An instance of a database result class
- */
- public final function getResultInstance () {
- return $this->resultInstance;
- }
-
/**
* Setter for debug instance
*
return $webOutputInstance;
}
- /**
- * Protected setter for user instance
- *
- * @param $userInstance An instance of a user class
- * @return void
- */
- protected final function setUserInstance (ManageableAccount $userInstance) {
- $this->userInstance = $userInstance;
- }
-
- /**
- * Getter for user instance
- *
- * @return $userInstance An instance of a user class
- */
- public final function getUserInstance () {
- return $this->userInstance;
- }
-
- /**
- * Setter for Cryptable instance
- *
- * @param $cryptoInstance An instance of a Cryptable class
- * @return void
- */
- protected final function setCryptoInstance (Cryptable $cryptoInstance) {
- $this->cryptoInstance = $cryptoInstance;
- }
-
- /**
- * Getter for Cryptable instance
- *
- * @return $cryptoInstance An instance of a Cryptable class
- */
- public final function getCryptoInstance () {
- return $this->cryptoInstance;
- }
-
/**
* Setter for DatabaseWrapper instance
*
* @return $entry An array with database entries
* @throws NullPointerException If the database result is not found
* @throws InvalidDatabaseResultException If the database result is invalid
+ * @todo Monolithic method, should be moved to proper classes
*/
protected final function getDatabaseEntry () {
// Is there an instance?
return $isSet;
}
- /**
- * Flushs all pending updates to the database layer
- *
- * @return void
- */
- public function flushPendingUpdates () {
- // Get result instance
- $resultInstance = $this->getResultInstance();
-
- // Do we have data to update?
- if ((is_object($resultInstance)) && ($resultInstance->ifDataNeedsFlush())) {
- // Get wrapper class name config entry
- $configEntry = $resultInstance->getUpdateInstance()->getWrapperConfigEntry();
-
- // Create object instance
- $wrapperInstance = DatabaseWrapperFactory::createWrapperByConfiguredName($configEntry);
-
- // Yes, then send the whole result to the database layer
- $wrapperInstance->doUpdateByResult($this->getResultInstance());
- }
- }
-
/**
* Outputs a deprecation warning to the developer.
*
use Org\Mxchange\CoreFramework\Helper\Template\HelpableTemplate;
use Org\Mxchange\CoreFramework\Registry\Registerable;
use Org\Mxchange\CoreFramework\Request\Requestable;
+use Org\Mxchange\CoreFramework\Traits\Result\Search\SearchableResultTrait;
/**
* A local payment discovery class. This class looks in local database for
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class LocalPaymentDiscovery extends BaseDiscovery implements Discoverable, Registerable {
+ // Load traits
+ use SearchableResultTrait;
+
/**
* Protected constructor
*
$userInstance->updateDatabaseField(UserDatabaseWrapper::DB_COLUMN_CONFIRM_HASH, '');
// Write all updates to the database
+ die(__METHOD__ . ': REWRITE!' . PHP_EOL);
$userInstance->flushPendingUpdates();
}
$authInstance->updateAuthData();
// Write all updates to the database
+ die(__METHOD__ . ': REWRITE!' . PHP_EOL);
$userInstance->flushPendingUpdates();
}
use Org\Mxchange\CoreFramework\Factory\ObjectFactory;
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
use Org\Mxchange\CoreFramework\Registry\Registerable;
+use Org\Mxchange\CoreFramework\Traits\Manager\Account\ManageableAccountTrait;
+use Org\Mxchange\CoreFramework\Traits\Result\Search\SearchableResultTrait;
use Org\Mxchange\CoreFramework\User\ManageableAccount;
/**
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class UserPoints extends BaseFrameworkSystem implements Registerable, BookablePoints {
+ // Load traits
+ use ManageableAccountTrait;
+ use SearchableResultTrait;
+
/**
* Amount of points
*/
use Org\Mxchange\CoreFramework\Reader\News\ReadableNews;
use Org\Mxchange\CoreFramework\Registry\Registerable;
use Org\Mxchange\CoreFramework\Request\Requestable;
+use Org\Mxchange\CoreFramework\Traits\Result\Search\SearchableResultTrait;
/**
* A console news reader class reads news from database layer
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class ConsoleNewsReader extends BaseFrameworkSystem implements ReadableNews, Registerable {
+ // Load traits
+ use SearchableResultTrait;
+
/**
* Protected constructor
*
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
use Org\Mxchange\CoreFramework\Registry\Registerable;
use Org\Mxchange\CoreFramework\Request\Requestable;
+use Org\Mxchange\CoreFramework\Traits\Result\Search\SearchableResultTrait;
/**
* A default news reader class reads news from database layer
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Registerable {
+ // Load traits
+ use SearchableResultTrait;
+
/**
* Protected constructor
*
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
use Org\Mxchange\CoreFramework\Request\Requestable;
use Org\Mxchange\CoreFramework\Result\Search\SearchableResult;
+use Org\Mxchange\CoreFramework\Traits\Result\Search\SearchableResultTrait;
/**
* A general user class
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
abstract class BaseUser extends BaseFrameworkSystem implements Updateable {
+ // Load traits
+ use SearchableResultTrait;
+
// Exception constances
const EXCEPTION_USERNAME_NOT_FOUND = 0x150;
const EXCEPTION_USER_EMAIL_NOT_FOUND = 0x151;
/**
* Updates the last activity timestamp and last performed action in the
- * database result. You should call flushPendingUpdates() to flush these updates
- * to the database layer.
+ * database result.
*
* @param $requestInstance A requestable class instance
* @return void
// No activity will be logged for guest accounts
}
- /**
- * Flushs all pending updates to the database layer
- *
- * @return void
- */
- public function flushPendingUpdates () {
- // No updates will be flushed to database!
- }
-
}
/**
* Updates the last activity timestamp and last performed action in the
- * database result. You should call flushPendingUpdates() to flush these updates
- * to the database layer.
+ * database result.
*
* @param $requestInstance A requestable class instance
* @return void
/**
* Setter for the *real* file input instance
*
- * @param $inputStream The *real* file-input class
+ * @param $inputStreamerInstance The *real* file-input class
* @return void
*/
- function setInputStream (FileInputStreamer $inputStream);
+ function setInputStreamerInstance (FileInputStreamer $inputStreamerInstance);
/**
* Getter for the *real* file input instance
*
* @return $inputStream The *real* file-input class
*/
- function getInputStream ();
+ function getInputStreamerInstance ();
/**
* Setter for the *real* file output instance
*
- * @param $outputStream The *real* file-output class
+ * @param $outputStreamerInstance The *real* file-output class
* @return void
*/
- function setOutputStream (FileOutputStreamer $outputStream);
+ function setOutputStreamerInstance (FileOutputStreamer $outputStreamerInstance);
/**
* Getter for the *real* file output instance
*
* @return $outputStream The *real* file-output class
*/
- function getOutputStream ();
+ function getOutputStreamerInstance ();
/**
* Saves a file with data by using the current output stream
* @param $objectInstance An instance of a FrameworkInterface class (default: NULL)
* @return void
*/
- function saveStreamToFile (SplFileInfo $infoInstance, $dataStream, FrameworkInterface $objectInstance = NULL);
+ function saveStreamToFile (SplFileInfo $infoInstance, string $dataStream, FrameworkInterface $objectInstance = NULL);
}
// Import framework stuff
use Org\Mxchange\CoreFramework\Object\BaseFrameworkSystem;
-use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
+use Org\Mxchange\CoreFramework\Traits\Streamer\Output\OutputStreamerTrait;
/**
* An abstract middleware class for all other middlware classes
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
abstract class BaseMiddleware extends BaseFrameworkSystem {
- /**
- * The concrete output instance
- */
- private $outputInstance = NULL;
+ // Load traits
+ use OutputStreamerTrait;
/**
* Protected constructor
parent::__construct($className);
}
- /**
- * Setter for output instance
- *
- * @param $outputInstance The debug output instance
- * @return void
- */
- protected final function setOutputInstance (OutputStreamer $outputInstance) {
- $this->outputInstance = $outputInstance;
- }
-
- /**
- * Getter for output instance
- *
- * @return $outputInstance The debug output instance
- */
- protected final function getOutputInstance () {
- return $this->outputInstance;
- }
-
}
use Org\Mxchange\CoreFramework\Generic\UnsupportedOperationException;
use Org\Mxchange\CoreFramework\Handler\Stream\IoHandler;
use Org\Mxchange\CoreFramework\Middleware\BaseMiddleware;
-use Org\Mxchange\CoreFramework\Stream\Filesystem\FileInputStreamer;
-use Org\Mxchange\CoreFramework\Stream\Filesystem\FileOutputStreamer;
+use Org\Mxchange\CoreFramework\Traits\Streamer\File\Input\FileInputStreamerTrait;
+use Org\Mxchange\CoreFramework\Traits\Streamer\File\Output\FileOutputStreamerTrait;
// Import SPL stuff
use \SplFileInfo;
* along with this program. If not, see <http://www.gnu.org/licenses/>.
*/
class FileIoHandler extends BaseMiddleware implements IoHandler {
- /**
- * The *real* file input class we shall use for reading data
- */
- private $inputStream = NULL;
-
- /**
- * The *real* file output class we shall use for reading data
- */
- private $outputStream = NULL;
+ // Load traits
+ use FileInputStreamerTrait;
+ use FileOutputStreamerTrait;
/**
* An instance of this class
$ioHandler = new FileIoHandler();
// Set the *real* file IO instances (both the same)
- $ioHandler->setInputStream(ObjectFactory::createObjectByConfiguredName('file_input_class'));
- $ioHandler->setOutputStream(ObjectFactory::createObjectByConfiguredName('file_output_class'));
+ $ioHandler->setInputStreamerInstance(ObjectFactory::createObjectByConfiguredName('file_input_class'));
+ $ioHandler->setOutputStreamerInstance(ObjectFactory::createObjectByConfiguredName('file_output_class'));
// Return instance
return $ioHandler;
return self::$selfInstance;
}
- /**
- * Setter for the *real* file input instance
- *
- * @param $inputStream The *real* file-input class
- * @return void
- */
- public final function setInputStream (FileInputStreamer $inputStream) {
- $this->inputStream = $inputStream;
- }
-
- /**
- * Getter for the *real* file input instance
- *
- * @return $inputStream The *real* file-input class
- */
- public final function getInputStream () {
- return $this->inputStream;
- }
-
- /**
- * Setter for the *real* file output instance
- *
- * @param $outputStream The *real* file-output class
- * @return void
- */
- public final function setOutputStream (FileOutputStreamer $outputStream) {
- $this->outputStream = $outputStream;
- }
-
- /**
- * Getter for the *real* file output instance
- *
- * @return $outputStream The *real* file-output class
- */
- public final function getOutputStream () {
- return $this->outputStream;
- }
/**
* Saves streamed (that are mostly serialized objects) data to files or
* external servers.
* @param $objectInstance An instance of a FrameworkInterface class (default: NULL)
* @return void
*/
- public function saveStreamToFile (SplFileInfo $infoInstance, $dataStream, FrameworkInterface $objectInstance = NULL) {
+ public function saveStreamToFile (SplFileInfo $infoInstance, string $dataStream, FrameworkInterface $objectInstance = NULL) {
// Default is this array
$className = $this->__toString();
);
// Send the infoInstance and dataArray to the output handler
- $this->getOutputStream()->saveFile($infoInstance, $dataArray);
+ $this->getOutputStreamerInstance()->saveFile($infoInstance, $dataArray);
}
/** Loads data from a file over the input handler
*/
public function loadFileContents (SplFileInfo $infoInstance) {
// Read from the input handler
- return $this->getInputStream()->loadFileContents($infoInstance);
+ return $this->getInputStreamerInstance()->loadFileContents($infoInstance);
}
/**
--- /dev/null
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Traits\Crypto;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Crypto\Cryptable;
+
+/**
+ * A trait for crypto classes
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+trait CryptoTrait {
+ /**
+ * Instance of a crypto helper
+ */
+ private $cryptoInstance = NULL;
+
+ /**
+ * Setter for Cryptable instance
+ *
+ * @param $cryptoInstance An instance of a Cryptable class
+ * @return void
+ */
+ protected final function setCryptoInstance (Cryptable $cryptoInstance) {
+ $this->cryptoInstance = $cryptoInstance;
+ }
+
+ /**
+ * Getter for Cryptable instance
+ *
+ * @return $cryptoInstance An instance of a Cryptable class
+ */
+ public final function getCryptoInstance () {
+ return $this->cryptoInstance;
+ }
+
+}
--- /dev/null
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Traits\Manager\Account;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\User\ManageableAccount;
+
+/**
+ * A trait for manageable user/guest accounts
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+trait ManageableAccountTrait {
+ /**
+ * Instance for user class
+ * @todo Rename to $accountInstance ?
+ */
+ private $userInstance = NULL;
+
+ /**
+ * Protected setter for user instance
+ *
+ * @param $userInstance An instance of a user class
+ * @return void
+ */
+ protected final function setUserInstance (ManageableAccount $userInstance) {
+ $this->userInstance = $userInstance;
+ }
+
+ /**
+ * Getter for user instance
+ *
+ * @return $userInstance An instance of a user class
+ */
+ public final function getUserInstance () {
+ return $this->userInstance;
+ }
+
+}
--- /dev/null
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Traits\Result\Search;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Result\Search\SearchableResult;
+
+/**
+ * A trait for searchable results
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+trait SearchableResultTrait {
+ /**
+ * Database result instance
+ */
+ private $resultInstance = NULL;
+
+ /**
+ * Setter for database result instance
+ *
+ * @param $resultInstance An instance of a database result class
+ * @return void
+ * @todo SearchableResult and UpdateableResult shall have a super interface to use here
+ */
+ protected final function setResultInstance (SearchableResult $resultInstance) {
+ $this->resultInstance = $resultInstance;
+ }
+
+ /**
+ * Getter for database result instance
+ *
+ * @return $resultInstance An instance of a database result class
+ */
+ public final function getResultInstance () {
+ return $this->resultInstance;
+ }
+
+}
--- /dev/null
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Traits\Streamer\File\Input;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Stream\Filesystem\FileInputStreamer;
+
+/**
+ * Trait for file input streamer
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+trait FileInputStreamerTrait {
+ /**
+ * The *real* file input class we shall use for reading data
+ */
+ private $inputStreamerInstance = NULL;
+
+ /**
+ * Setter for the *real* file input instance
+ *
+ * @param $inputStreamerInstance The *real* file-input class
+ * @return void
+ */
+ public final function setInputStreamerInstance (FileInputStreamer $inputStreamerInstance) {
+ $this->inputStreamerInstance = $inputStreamerInstance;
+ }
+
+ /**
+ * Getter for the *real* file input instance
+ *
+ * @return $inputStreamerInstance The *real* file-input class
+ */
+ public final function getInputStreamerInstance () {
+ return $this->inputStreamerInstance;
+ }
+
+}
--- /dev/null
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Traits\Streamer\File\Output;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Stream\Filesystem\FileOutputStreamer;
+
+/**
+ * A trait for file output streamer
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+trait FileOutputStreamerTrait {
+ /**
+ * The *real* file output class we shall use for reading data
+ */
+ private $outputStreamerInstance = NULL;
+
+ /**
+ * Setter for the *real* file output instance
+ *
+ * @param $outputStreamerInstance The *real* file-output class
+ * @return void
+ */
+ public final function setOutputStreamerInstance (FileOutputStreamer $outputStreamerInstance) {
+ $this->outputStreamerInstance = $outputStreamerInstance;
+ }
+
+ /**
+ * Getter for the *real* file output instance
+ *
+ * @return $outputStreamerInstance The *real* file-output class
+ */
+ public final function getOutputStreamerInstance () {
+ return $this->outputStreamerInstance;
+ }
+
+}
--- /dev/null
+<?php
+// Own namespace
+namespace Org\Mxchange\CoreFramework\Traits\Streamer\Output;
+
+// Import framework stuff
+use Org\Mxchange\CoreFramework\Stream\Output\OutputStreamer;
+
+/**
+ * A trait for output streamer instance
+ *
+ * @author Roland Haeder <webmaster@shipsimu.org>
+ * @version 0.0.0
+ * @copyright Copyright (c) 2007, 2008 Roland Haeder, 2009 - 2020 Core Developer Team
+ * @license GNU GPL 3.0 or any newer version
+ * @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
+ * the Free Software Foundation, either version 3 of the License, or
+ * (at your option) any later version.
+ *
+ * This program is distributed in the hope that it will be useful,
+ * but WITHOUT ANY WARRANTY; without even the implied warranty of
+ * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ * GNU General Public License for more details.
+ *
+ * You should have received a copy of the GNU General Public License
+ * along with this program. If not, see <http://www.gnu.org/licenses/>.
+ */
+trait OutputStreamerTrait {
+ /**
+ * The concrete output instance
+ */
+ private $outputInstance = NULL;
+
+ /**
+ * Setter for output instance
+ *
+ * @param $outputInstance The debug output instance
+ * @return void
+ */
+ protected final function setOutputInstance (OutputStreamer $outputInstance) {
+ $this->outputInstance = $outputInstance;
+ }
+
+ /**
+ * Getter for output instance
+ *
+ * @return $outputInstance The debug output instance
+ */
+ protected final function getOutputInstance () {
+ return $this->outputInstance;
+ }
+
+}