Alexander Nicolaysen Sørnes : Tag: Make the class more extandable

Alexander Nicolaysen Sørnes asornes at winehq.org
Sun Apr 24 15:44:01 CDT 2011


Module: appdb
Branch: master
Commit: 49cb8686806957d42bae87f4d6c3fb72c0e4e5a4
URL:    http://source.winehq.org/git/appdb.git/?a=commit;h=49cb8686806957d42bae87f4d6c3fb72c0e4e5a4

Author: Alexander Nicolaysen Sørnes <alexsornes at gmail.com>
Date:   Sun Apr 24 22:33:46 2011 +0200

Tag: Make the class more extandable

---

 include/tag.php |   17 +++++++++--------
 1 files changed, 9 insertions(+), 8 deletions(-)

diff --git a/include/tag.php b/include/tag.php
index 117234e..c9fac08 100644
--- a/include/tag.php
+++ b/include/tag.php
@@ -1,11 +1,13 @@
 <?php
 
+require_once(BASE.'include/objectManagerBase.php');
+
 abstract class Tag extends ObjectManagerBase
 {
-    private $bMultipleAssignments;
-    private $sTextId;
-    private $sName;
-    private $sDescription;
+    protected $bMultipleAssignments;
+    protected $sTextId;
+    protected $sName;
+    protected $sDescription;
     
     function Constructor($iId = null, $oRow = null, $sTextId = '')
     {
@@ -158,7 +160,7 @@ abstract class Tag extends ObjectManagerBase
 
 public function objectGetEntriesCount()
     {
-        $hResult = query_parameters("SELECT COUNT(id) as count FROM ? WHERE state = 'accepted'", $this->objectGetSQLTable());
+        $hResult = query_parameters("SELECT COUNT(*) as count FROM ? WHERE state = 'accepted'", $this->objectGetSQLTable());
 
         if(!$hResult)
             return false;
@@ -230,12 +232,11 @@ public function objectGetEntriesCount()
         return $shRet;
     }
 
-    public function getAssignTagsEditor($iAssignedFor = null)
+    public function getAssignTagsEditor($iAssignedFor = null, $aSelected = array())
     {
         $shRet = '';
-        $aSelected = array();
 
-        if($iAssignedFor)
+        if(!sizeof($aSelected) && $iAssignedFor)
             $aSelected = $this->getAssignedTags($iAssignedFor);
 
         foreach($this->getTags() as $oTag)




More information about the wine-cvs mailing list