]> git.mxchange.org Git - city.git/blobdiff - application/city/classes/database/frontend/city_entities/sections/class_CitySectionsDatabaseFrontend.php
Continued:
[city.git] / application / city / classes / database / frontend / city_entities / sections / class_CitySectionsDatabaseFrontend.php
index f8608118d05fbbde90d3680763241cc67b1f2561..a3b7fda6d3d8c89e81aec483675c96696ec2ce5f 100644 (file)
@@ -130,7 +130,7 @@ class CitySectionsDatabaseFrontend extends BaseDatabaseFrontend implements CityS
         */
        public function ifCityHasSections (int $cityId) {
                // Check parameter
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('CITY-SECTIONS-DATABASE-FRONTEND: cityId=%d - CALLED!', $cityId));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->traceMessage(sprintf('CITY-SECTIONS-DATABASE-FRONTEND: cityId=%d - CALLED!', $cityId));
                if ($cityId < 1) {
                        // Throw IAE
                        throw new InvalidArgumentException(sprintf('cityId=%d is not a valid id', $cityId), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
@@ -152,11 +152,11 @@ class CitySectionsDatabaseFrontend extends BaseDatabaseFrontend implements CityS
                $resultInstance = $this->doSelectByCriteria($searchInstance);
 
                // Check if there is one entry
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('CITY-SECTIONS-DATABASE-FRONTEND: resultInstance=%s', $resultInstance->__toString()));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugMessage(sprintf('CITY-SECTIONS-DATABASE-FRONTEND: resultInstance=%s', $resultInstance->__toString()));
                $isFound = $resultInstance->next();
 
                // Return result
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('CITY-SECTIONS-DATABASE-FRONTEND: isFound=%d - EXIT!', intval($isFound)));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->traceMessage(sprintf('CITY-SECTIONS-DATABASE-FRONTEND: isFound=%d - EXIT!', intval($isFound)));
                return $isFound;
        }
 
@@ -171,7 +171,7 @@ class CitySectionsDatabaseFrontend extends BaseDatabaseFrontend implements CityS
         */
        public function doInitialCityExpansion (int $cityId) {
                // Check parameter
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('CITY-SECTIONS-DATABASE-FRONTEND: cityId=%d - CALLED!', $cityId));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->traceMessage(sprintf('CITY-SECTIONS-DATABASE-FRONTEND: cityId=%d - CALLED!', $cityId));
                if ($cityId < 1) {
                        // Throw IAE
                        throw new InvalidArgumentException(sprintf('cityId=%d is not a valid id', $cityId), FrameworkInterface::EXCEPTION_INVALID_ARGUMENT);
@@ -199,7 +199,7 @@ class CitySectionsDatabaseFrontend extends BaseDatabaseFrontend implements CityS
                $totalSections = (($radius + 1) * ($radius + 1) * $maxUp * ($maxDown + 1));
 
                // Get data set instance
-               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput(sprintf('CITY-SECTIONS-DATABASE-FRONTEND: radius=%d,maxUp=%d,maxDown=%d,totalSections=%d', $radius, $maxUp, $maxDown, $totalSections));
+               /* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugMessage(sprintf('CITY-SECTIONS-DATABASE-FRONTEND: radius=%d,maxUp=%d,maxDown=%d,totalSections=%d', $radius, $maxUp, $maxDown, $totalSections));
                $dataSetInstance = ObjectFactory::createObjectByConfiguredName('dataset_criteria_class', array(self::DB_TABLE_CITY_SECTIONS));
 
                // Add values for "zero point"
@@ -232,7 +232,7 @@ class CitySectionsDatabaseFrontend extends BaseDatabaseFrontend implements CityS
                $sections = [];
 
                // Output message to ask for user's patience ...
-               self::createDebugInstance(__CLASS__)->debugOutput(sprintf('CITY-SECTIONS-DATABASE-FRONTEND: Writing %d sections for city %d ... (this may takes some time)', $totalSections, $cityId));
+               self::createDebugInstance(__CLASS__)->debugMessage(sprintf('CITY-SECTIONS-DATABASE-FRONTEND: Writing %d sections for city %d ... (this may takes some time)', $totalSections, $cityId));
 
                // Expand half of it to north/south (north=positive, south=negative)
                for ($north = 1; $north < round($radius / 2); $north++) {
@@ -241,7 +241,7 @@ class CitySectionsDatabaseFrontend extends BaseDatabaseFrontend implements CityS
                                // Expand up/down (including "zero point")
                                for ($z = $maxDown; $z < ($maxUp + 1); $z++) {
                                        // Fill array up with south/east/down ids
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: north=' . $north . ',west=' . $west . ',z=' . $z);
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugMessage('[' . __METHOD__ . ':' . __LINE__ . ']: north=' . $north . ',west=' . $west . ',z=' . $z);
                                        $sections[($north * -1)][($west * -1)][$z]['type'] = self::SECTION_TYPE_EMPTY_LAND;
                                        $sections[($north * -1)][($west * -1)][$z]['sub']  = self::SECTION_SUB_TYPE_GRASS;
 
@@ -262,7 +262,7 @@ class CitySectionsDatabaseFrontend extends BaseDatabaseFrontend implements CityS
                                // Loop through up/down values
                                foreach ($sectionY as $z => $sectionData) {
                                        // Set all coordinates for positive directions
-                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: x=' . $x . ',y=' . $y . ',z=' . $z . ',sectionId=' . $sectionId);
+                                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugMessage('[' . __METHOD__ . ':' . __LINE__ . ']: x=' . $x . ',y=' . $y . ',z=' . $z . ',sectionId=' . $sectionId);
                                        $dataSetInstance->setCriteria(self::DB_COLUMN_SECTION_ID        , $sectionId);
                                        $dataSetInstance->setCriteria(self::DB_COLUMN_SECTION_POSITION_X, $x);
                                        $dataSetInstance->setCriteria(self::DB_COLUMN_SECTION_POSITION_Y, $y);
@@ -278,14 +278,14 @@ class CitySectionsDatabaseFrontend extends BaseDatabaseFrontend implements CityS
                                }
 
                                // Debug message
-                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: x=' . $x . ',y=' . $y . ' has been written.');
+                               //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugMessage('[' . __METHOD__ . ':' . __LINE__ . ']: x=' . $x . ',y=' . $y . ' has been written.');
                        }
 
                        // Debug message
-                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: x=' . $x . ' has been written.');
+                       //* NOISY-DEBUG: */ self::createDebugInstance(__CLASS__)->debugMessage('[' . __METHOD__ . ':' . __LINE__ . ']: x=' . $x . ' has been written.');
                }
 
                // Thank you for waiting! :-)
-               self::createDebugInstance(__CLASS__)->debugOutput('[' . __METHOD__ . ':' . __LINE__ . ']: A total of ' . $totalSections . ' sections has been written for city id ' . $cityId . '.');
+               self::createDebugInstance(__CLASS__)->debugMessage(sprintf('A total of %d sections has been written for city id %s', $totalSections, $cityId));
        }
 }