예제 #1
0
 /**
  * Returns an array of Positions
  *
  * @param int $index Index of this leaf
  * @param array $indices Parent Indices
  *
  * @return array
  */
 public function getPositionsByIndices($index, array $indices)
 {
     if (!is_numeric($index) || !is_array($indices)) {
         if (TYPO3_DLOG) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('getPositionsByIndices (productdata) gets passed invalid parameters.', COMMERCE_EXTKEY, 3);
         }
         return array();
     }
     // Construct the Array of Position Ids
     $firstIndex = $indices[0];
     if (!is_array($this->positionArray[$firstIndex])) {
         if (TYPO3_DLOG) {
             \TYPO3\CMS\Core\Utility\GeneralUtility::devLog('getPositionsByIndices (Tx_Commerce_Tree_Leaf_SlaveData) does not find the first Index in the position array.', COMMERCE_EXTKEY, 2);
         }
         $this->positionUids = array();
         return $this->positionUids;
     }
     $this->mountIds = array_keys($this->positionArray[$firstIndex]);
     return parent::getPositionsByIndices($index, $indices);
 }
예제 #2
0
 /**
  * Loads the records of a given query and stores it
  *
  * @return array Records array
  */
 public function loadRecords()
 {
     $rows = parent::loadRecords();
     // Add the root if it is the starting ID or in the mounts
     if (!$this->ignoreMounts && (!$this->useMountpoints && $this->uid == 0 || $this->useMountpoints && in_array(0, $this->mountIds))) {
         $rows['uid'][0] = $this->getRootRecord();
     }
     $this->records = $rows;
     return $rows;
 }