Opps, needs to rename the class
authorRoland Häder <roland@mxchange.org>
Sat, 18 Jul 2009 08:05:45 +0000 (08:05 +0000)
committerRoland Häder <roland@mxchange.org>
Sat, 18 Jul 2009 08:05:45 +0000 (08:05 +0000)
inc/classes/main/reader/class_ConsoleNewsReader.php

index 0240b74da57e77a262cce8181f67735205b307c1..e954686adb4eab0fad7c1e3a599204c67e969dff 100644 (file)
@@ -1,6 +1,6 @@
 <?php
 /**
 <?php
 /**
- * A default news reader class reads news from database layer
+ * A console news reader class reads news from database layer
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
  *
  * @author             Roland Haeder <webmaster@ship-simu.org>
  * @version            0.0.0
@@ -21,7 +21,7 @@
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
  * You should have received a copy of the GNU General Public License
  * along with this program. If not, see <http://www.gnu.org/licenses/>.
  */
-class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Registerable {
+class ConsoleNewsReader extends BaseFrameworkSystem implements ReadableNews, Registerable {
        /**
         * Protected constructor
         *
        /**
         * Protected constructor
         *
@@ -42,9 +42,9 @@ class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg
         * @param       $requestInstance        An instance of a Requestable class
         * @return      $readerInstance         An instance of this reader class
         */
         * @param       $requestInstance        An instance of a Requestable class
         * @return      $readerInstance         An instance of this reader class
         */
-       public final static function createDefaultNewsReader (Requestable $requestInstance) {
+       public final static function createConsoleNewsReader (Requestable $requestInstance) {
                // Get a new instance
                // Get a new instance
-               $readerInstance = new DefaultNewsReader();
+               $readerInstance = new ConsoleNewsReader();
 
                // Set request instance
                $readerInstance->setRequestInstance($requestInstance);
 
                // Set request instance
                $readerInstance->setRequestInstance($requestInstance);
@@ -54,14 +54,14 @@ class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg
        }
 
        /**
        }
 
        /**
-        * Initializes this reader class by pre-fetching news depending on 'page'
+        * Initializes this reader class by pre-fetching news depending on 'command'
         * (outside or login area), which amount of news and how much to skip
         *
         * @return      void
         */
        public function initializeReader () {
         * (outside or login area), which amount of news and how much to skip
         *
         * @return      void
         */
        public function initializeReader () {
-               // Get 'page' for saving some calls
-               $page = $this->getRequestInstance()->getRequestElement('page');
+               // Get 'command' for saving some calls
+               $command = $this->getRequestInstance()->getRequestElement('command');
 
                // First get a wrapper instance
                $wrapperInstance = ObjectFactory::createObjectByConfiguredName('news_db_wrapper_class');
 
                // First get a wrapper instance
                $wrapperInstance = ObjectFactory::createObjectByConfiguredName('news_db_wrapper_class');
@@ -69,11 +69,11 @@ class DefaultNewsReader extends BaseFrameworkSystem implements ReadableNews, Reg
                // Next create a searchable criteria instance
                $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
 
                // Next create a searchable criteria instance
                $criteriaInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
 
-               // Add the page as criteria to it at lease
-               $criteriaInstance->addCriteria('page', $page);
+               // Add the command as criteria to it at lease
+               $criteriaInstance->addCriteria('page', $command);
 
                // Add limitation from config
 
                // Add limitation from config
-               $criteriaInstance->setLimit($this->getConfigInstance()->readConfig('news_' . $page . '_limit'));
+               $criteriaInstance->setLimit($this->getConfigInstance()->readConfig('news_' . $command . '_limit'));
 
                // Get a resultInstance back from the database
                $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);
 
                // Get a resultInstance back from the database
                $resultInstance = $wrapperInstance->doSelectByCriteria($criteriaInstance);