Explorar o código

#2358 Speed optimization

Alex Trofimov %!s(int64=7) %!d(string=hai) anos
pai
achega
f498d6b471
Modificáronse 2 ficheiros con 12 adicións e 0 borrados
  1. 3 0
      inc/classes/BxDolAccountQuery.php
  2. 9 0
      inc/classes/BxDolProfileQuery.php

+ 3 - 0
inc/classes/BxDolAccountQuery.php

@@ -91,6 +91,9 @@ class BxDolAccountQuery extends BxDolDb implements iBxDolSingleton
      */
     public function getIdById($iId, $bClearCache = false)
     {
+        if (!$iId)
+            return false;
+
         $sKey = 'BxDolAccountQuery::getIdById' . $iId;
         if ($bClearCache)
             $this->cleanMemory($sKey);

+ 9 - 0
inc/classes/BxDolProfileQuery.php

@@ -75,6 +75,9 @@ class BxDolProfileQuery extends BxDolDb implements iBxDolSingleton
      */
     public function getProfileByContentAndType ($iContentId, $sType, $bClearCache = false)
     {
+        if (!$iContentId)
+            return false;
+
         $sKey = 'BxDolProfileQuery::getProfileByContentAndType' . $iContentId . $sType;
         if ($bClearCache)
             $this->cleanMemory($sKey);
@@ -152,6 +155,9 @@ class BxDolProfileQuery extends BxDolDb implements iBxDolSingleton
      */
     public function getCurrentProfileByAccount ($iAccountId, $bClearCache = false)
     {
+        if (!$iAccountId)
+            return false;
+
         $sKey = 'BxDolProfileQuery::getCurrentProfileByAccount' . $iAccountId;
         if ($bClearCache)
             $this->cleanMemory($sKey);
@@ -190,6 +196,9 @@ class BxDolProfileQuery extends BxDolDb implements iBxDolSingleton
      */
     public function getIdById($iId, $bClearCache = false)
     {
+        if (!$iId)
+            return false;
+
         $sKey = 'BxDolProfileQuery::getIdById' . $iId;
         if ($bClearCache)
             $this->cleanMemory($sKey);