[pLog-svn] r7248 - in plog/branches/lifetype-1.2/class/dao: . status

jondaley at devel.lifetype.net jondaley at devel.lifetype.net
Wed Oct 14 01:36:24 EDT 2020


Author: jondaley
Date: 2020-10-14 01:36:24 -0400 (Wed, 14 Oct 2020)
New Revision: 7248

Modified:
   plog/branches/lifetype-1.2/class/dao/articlecommentstatus.class.php
   plog/branches/lifetype-1.2/class/dao/articlestatus.class.php
   plog/branches/lifetype-1.2/class/dao/blogstatus.class.php
   plog/branches/lifetype-1.2/class/dao/status/genericstatuslist.class.php
   plog/branches/lifetype-1.2/class/dao/userstatus.class.php
Log:
child class functions have to match parent class functions in php7

Modified: plog/branches/lifetype-1.2/class/dao/articlecommentstatus.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/articlecommentstatus.class.php	2020-09-23 17:17:31 UTC (rev 7247)
+++ plog/branches/lifetype-1.2/class/dao/articlecommentstatus.class.php	2020-10-14 05:36:24 UTC (rev 7248)
@@ -15,21 +15,11 @@
     class ArticleCommentStatus extends GenericStatusList
     {
     
-        /**
-         * returns a list with all the statuses that have been defined for comments. 
-		 * If you wish to define your own custom status, then simply in your plugin define
-		 * COMMENT_STATUS_XXX and give it a sensible value.
-         *
-         * @return Returns an array where every position is an array with two
-         * keys: "constant" and "value", where "constant" is the name of the constant
-         * that defines this status and "value" is the value assigned to it
-		 * @static
-         */
-        function getStatusList( $includeStatusAll = false )
-        {
-			return( GenericStatusList::getStatusList( "COMMENT_STATUS_", "COMMENT_STATUS_ALL", $includeStatusAll ));
+        function ArticleCommentStatus(){
+            $this->_prefix = "COMMENT_STATUS_";
+            $this->_statusAllId = "COMMENT_STATUS_ALL";
         }
-		
+        
 		/**
 		 * returns whether a status has previously been defined or not
 		 *
@@ -47,4 +37,4 @@
 			return $isValid;
 		}
     }
-?>
\ No newline at end of file
+?>

Modified: plog/branches/lifetype-1.2/class/dao/articlestatus.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/articlestatus.class.php	2020-09-23 17:17:31 UTC (rev 7247)
+++ plog/branches/lifetype-1.2/class/dao/articlestatus.class.php	2020-10-14 05:36:24 UTC (rev 7248)
@@ -21,18 +21,8 @@
      */    	
     class ArticleStatus extends GenericStatusList
     {
-    
-        /**
-         * returns a list with all the post statuses that have been defined
-         * so far in the code.
-         *
-         * @return Returns an array where every position is an array with two
-         * keys: "constant" and "value", where "constant" is the name of the constant
-         * that defines this status and "value" is the value assigned to it
-         */
-        function getStatusList( $includeStatusAll = false )
-        {
-			return( GenericStatusList::getStatusList( "POST_STATUS_", "POST_STATUS_ALL", $includeStatusAll ));
+        function ArticleStatus(){
+            $this->_prefix = "POST_STATUS_";
+            $this->_statusAllId = "POST_STATUS_ALL";
         }
     }
-?>
\ No newline at end of file

Modified: plog/branches/lifetype-1.2/class/dao/blogstatus.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/blogstatus.class.php	2020-09-23 17:17:31 UTC (rev 7247)
+++ plog/branches/lifetype-1.2/class/dao/blogstatus.class.php	2020-10-14 05:36:24 UTC (rev 7248)
@@ -16,17 +16,9 @@
     class BlogStatus extends GenericStatusList
     {
     
-        /**
-         * returns a list with all the user statuses that have been defined
-         * so far in the code.
-         *
-         * @return Returns an array where every position is an array with two
-         * keys: "constant" and "value", where "constant" is the name of the constant
-         * that defines this status and "value" is the value assigned to it
-         */
-        function getStatusList( $includeStatusAll = false )
-        {
-            return( GenericStatusList::getStatusList( "BLOG_STATUS_", "BLOG_STATUS_ALL", $includeStatusAll ));
+        function BlogStatus(){
+            $this->_prefix = "BLOG_STATUS_";
+            $this->_statusAllId = "BLOG_STATUS_ALL";
         }
         
         /**
@@ -50,4 +42,4 @@
 	     	return( BLOG_STATUS_ALL );   
         }        
     }
-?>
\ No newline at end of file
+?>

Modified: plog/branches/lifetype-1.2/class/dao/status/genericstatuslist.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/status/genericstatuslist.class.php	2020-09-23 17:17:31 UTC (rev 7247)
+++ plog/branches/lifetype-1.2/class/dao/status/genericstatuslist.class.php	2020-10-14 05:36:24 UTC (rev 7248)
@@ -14,7 +14,14 @@
 	 */
     class GenericStatusList 
     {
-    
+
+        var $_prefix;
+        var $_statusAllId;
+        
+        function GenericStatusList(){
+                // child classes should set $_prefix and $_statusAllId
+        }
+        
         /**
          * returns a list with all the user statuses that have been defined
          * so far in the code.
@@ -23,7 +30,7 @@
          * keys: "constant" and "value", where "constant" is the name of the constant
          * that defines this status and "value" is the value assigned to it
          */
-        function getStatusList( $prefix, $statusAllId, $includeStatusAll = false )
+        function getStatusList( $includeStatusAll = false )
         {
             // get all the constants defined so far
             $constants = get_defined_constants();
@@ -30,12 +37,12 @@
             $statusList = Array();
 			
 			if( $includeStatusAll ) {
-				$statusAllLowercase = strtolower( $statusAllId );
+				$statusAllLowercase = strtolower( $this->_statusAllId );
 				$statusList["$statusAllLowercase"] = -1;
 			}
 
             foreach( $constants as $constant => $value ) {
-                if( substr( $constant, 0, strlen($prefix)) == $prefix && $constant != $statusAllId ) {
+                if( substr( $constant, 0, strlen($this->_prefix)) == $this->_prefix && $constant != $this->_statusAllId ) {
 					$constant = strtolower($constant);
                     $statusList[ "$constant" ] = $value;
                 }
@@ -69,4 +76,4 @@
 	     	return( true );
         }        
     }
-?>
\ No newline at end of file
+?>

Modified: plog/branches/lifetype-1.2/class/dao/userstatus.class.php
===================================================================
--- plog/branches/lifetype-1.2/class/dao/userstatus.class.php	2020-09-23 17:17:31 UTC (rev 7247)
+++ plog/branches/lifetype-1.2/class/dao/userstatus.class.php	2020-10-14 05:36:24 UTC (rev 7248)
@@ -15,18 +15,10 @@
      */    
     class UserStatus extends GenericStatusList
     {
-    
-        /**
-         * returns a list with all the user statuses that have been defined
-         * so far in the code.
-         *
-         * @return Returns an array where every position is an array with two
-         * keys: "constant" and "value", where "constant" is the name of the constant
-         * that defines this status and "value" is the value assigned to it
-         */
-        function getStatusList( $includeStatusAll = false )
-        {
-			return( GenericStatusList::getStatusList( "USER_STATUS_", "USER_STATUS_ALL", $includeStatusAll ));
+
+        function UserStatus(){
+            $this->_prefix = "USER_STATUS_";
+            $this->_statusAllId = "USER_STATUS_ALL";
         }
         
         /**



More information about the pLog-svn mailing list