From 9787aa299f93ee4c579377b4174831454ab563c1 Mon Sep 17 00:00:00 2001 From: =?utf8?q?Roland=20H=C3=A4der?= Date: Tue, 1 Dec 2020 23:25:35 +0100 Subject: [PATCH] Continued: - added $helperInstance and getter/setter from framework as it was monolithic there - updated core framework MIME-Version: 1.0 Content-Type: text/plain; charset=utf8 Content-Transfer-Encoding: 8bit Signed-off-by: Roland Häder --- .../socket/class_SocketContainer.php | 25 +++++++++++++++++ .../hub/classes/info/class_BaseInfo.php | 27 +++++++++++++++++++ .../work_units/class_BaseUnitProducer.php | 25 +++++++++++++++++ core | 2 +- 4 files changed, 78 insertions(+), 1 deletion(-) diff --git a/application/hub/classes/container/socket/class_SocketContainer.php b/application/hub/classes/container/socket/class_SocketContainer.php index 283258f01..eb2ad4bd9 100644 --- a/application/hub/classes/container/socket/class_SocketContainer.php +++ b/application/hub/classes/container/socket/class_SocketContainer.php @@ -18,6 +18,7 @@ use Org\Shipsimu\Hub\Handler\Package\NetworkPackageHandler; use Org\Mxchange\CoreFramework\Bootstrap\FrameworkBootstrap; use Org\Mxchange\CoreFramework\Factory\ObjectFactory; use Org\Mxchange\CoreFramework\Generic\NullPointerException; +use Org\Mxchange\CoreFramework\Helper\Helper; use Org\Mxchange\CoreFramework\Registry\Registerable; use Org\Mxchange\CoreFramework\Socket\InvalidSocketException; use Org\Mxchange\CoreFramework\Socket\NoSocketErrorDetectedException; @@ -115,6 +116,11 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita */ private $socketResource = false; + /** + * A helper instance for the form + */ + private $helperInstance = NULL; + /** * Protected constructor * @@ -1529,4 +1535,23 @@ class SocketContainer extends BaseHubContainer implements StorableSocket, Visita return $this->socketResource; } + /** + * Setter for helper instance + * + * @param $helperInstance An instance of a helper class + * @return void + */ + protected final function setHelperInstance (Helper $helperInstance) { + $this->helperInstance = $helperInstance; + } + + /** + * Getter for helper instance + * + * @return $helperInstance An instance of a helper class + */ + public final function getHelperInstance () { + return $this->helperInstance; + } + } diff --git a/application/hub/classes/info/class_BaseInfo.php b/application/hub/classes/info/class_BaseInfo.php index 4cfee87e1..f56407093 100644 --- a/application/hub/classes/info/class_BaseInfo.php +++ b/application/hub/classes/info/class_BaseInfo.php @@ -5,6 +5,9 @@ namespace Org\Shipsimu\Hub\Information; // Import application-specific stuff use Org\Shipsimu\Hub\Generic\BaseHubSystem; +// Import framework-specific stuff +use Org\Mxchange\CoreFramework\Helper\Helper; + /** * A general Info class * @@ -28,6 +31,11 @@ use Org\Shipsimu\Hub\Generic\BaseHubSystem; * along with this program. If not, see . */ abstract class BaseInfo extends BaseHubSystem { + /** + * A helper instance for the form + */ + private $helperInstance = NULL; + /** * Protected constructor * @@ -39,4 +47,23 @@ abstract class BaseInfo extends BaseHubSystem { parent::__construct($className); } + /** + * Setter for helper instance + * + * @param $helperInstance An instance of a helper class + * @return void + */ + protected final function setHelperInstance (Helper $helperInstance) { + $this->helperInstance = $helperInstance; + } + + /** + * Getter for helper instance + * + * @return $helperInstance An instance of a helper class + */ + public final function getHelperInstance () { + return $this->helperInstance; + } + } diff --git a/application/hub/classes/producer/cruncher/work_units/class_BaseUnitProducer.php b/application/hub/classes/producer/cruncher/work_units/class_BaseUnitProducer.php index bc801b509..8091aff6f 100644 --- a/application/hub/classes/producer/cruncher/work_units/class_BaseUnitProducer.php +++ b/application/hub/classes/producer/cruncher/work_units/class_BaseUnitProducer.php @@ -6,6 +6,7 @@ namespace Org\Shipsimu\Hub\Producer\Cruncher\Unit; use Org\Shipsimu\Hub\Producer\Cruncher\BaseCruncherProducer; // Import framework stuff +use Org\Mxchange\CoreFramework\Helper\Helper; use Org\Mxchange\CoreFramework\Template\CompileableTemplate; /** @@ -49,6 +50,11 @@ abstract class BaseUnitProducer extends BaseCruncherProducer { */ private $templateInstance = NULL; + /** + * A helper instance for the form + */ + private $helperInstance = NULL; + /** * Protected constructor * @@ -79,4 +85,23 @@ abstract class BaseUnitProducer extends BaseCruncherProducer { return $this->templateInstance; } + /** + * Setter for helper instance + * + * @param $helperInstance An instance of a helper class + * @return void + */ + protected final function setHelperInstance (Helper $helperInstance) { + $this->helperInstance = $helperInstance; + } + + /** + * Getter for helper instance + * + * @return $helperInstance An instance of a helper class + */ + public final function getHelperInstance () { + return $this->helperInstance; + } + } diff --git a/core b/core index 5c227d3d4..28ff0710d 160000 --- a/core +++ b/core @@ -1 +1 @@ -Subproject commit 5c227d3d4b639d9e5141bb218c414eb877250cf4 +Subproject commit 28ff0710d8eb3a2d0c1547d6ebeaae05eb50c7f6 -- 2.39.5