ソースを参照

Ticket #4971 - Build-in API support: Get rid of validation. Recommendation.

AntonLV 11 ヶ月 前
親
コミット
f2f3a2805b
1 ファイル変更、10 行追加、24 行削除
  1. 10 24
      template/scripts/BxBaseRecommendation.php

+ 10 - 24
template/scripts/BxBaseRecommendation.php

@@ -97,21 +97,17 @@ class BxBaseRecommendation extends BxDolRecommendation
         $iStart = !empty($aParams['start']) ? (int)$aParams['start'] : 0;
         $iStart = !empty($aParams['start']) ? (int)$aParams['start'] : 0;
         $iPerPage = !empty($aParams['per_page']) ? (int)$aParams['per_page'] : $this->_iPerPageDefault;
         $iPerPage = !empty($aParams['per_page']) ? (int)$aParams['per_page'] : $this->_iPerPageDefault;
 
 
-        if(empty($aParams['validate']) || !is_array($aParams['validate'])) {
-            $aItems = [];
-            if(!defined('BX_API_PAGE'))
-                $aItems = $this->_oDb->get($iProfileId, $this->_aObject['id'], $aParams);
-
-            $aData = [];
-            foreach($aItems as $iId => $iCount) {
-                $aItem = $this->getCodeItem($iId, $iCount);
-                $aItem['id'] = $iId;
-
-                $aData[] = $aItem;
-            }
+        $aItems = [];
+        if(!defined('BX_API_PAGE'))
+            $aItems = $this->_oDb->get($iProfileId, $this->_aObject['id'], $aParams);
+
+        $aData = [];
+        foreach($aItems as $iId => $iCount) {
+            $aItem = $this->getCodeItem($iId, $iCount);
+            $aItem['id'] = $iId;
+
+            $aData[] = $aItem;
         }
         }
-        else
-            $aData = $this->validate($iProfileId, $aParams);
 
 
         return [
         return [
             'request_url' => '',
             'request_url' => '',
@@ -122,16 +118,6 @@ class BxBaseRecommendation extends BxDolRecommendation
             ],
             ],
         ];
         ];
     }
     }
-
-    public function validate($iProfileId = 0, $aParams = [])
-    {
-        $aItems = $this->_oDb->get($iProfileId, $this->_aObject['id'], array_merge($aParams, [
-            'start' => 0,
-            'per_page' => count($aParams['validate'])
-        ]));
-
-        return sort(array_keys($aItems)) == sort($aParams['validate']) ? 'valid' : 'invalid';
-    }
 }
 }
 
 
 /** @} */
 /** @} */