コード例 #1
0
 /**
  * Returns the parent Product uid
  *
  * @param int $uid Article uid
  * @param bool $translationMode Translation mode
  *
  * @return int product uid
  */
 public function getParentProductUid($uid, $translationMode = FALSE)
 {
     $data = parent::getData($uid, $translationMode);
     $result = FALSE;
     if ($data) {
         // Backwards Compatibility
         if ($data['uid_product']) {
             $result = $data['uid_product'];
         } elseif ($data['products_uid']) {
             $result = $data['products_uid'];
         }
     }
     return $result;
 }
コード例 #2
0
ファイル: AbstractEntity.php プロジェクト: AndreasA/commerce
 /**
  * Loads the Data from the database
  * via the named database class $databaseClass
  *
  * @param bool $translationMode Translation mode of the record,
  * 	default false to use the default way of translation
  *
  * @return array
  */
 public function loadData($translationMode = FALSE)
 {
     if ($translationMode) {
         $this->translationMode = $translationMode;
     }
     if (!$this->databaseConnection) {
         $this->databaseConnection = \TYPO3\CMS\Core\Utility\GeneralUtility::makeInstance($this->databaseClass);
     }
     $this->data = $this->databaseConnection->getData($this->uid, $this->lang_uid, $translationMode);
     if (!$this->data) {
         $this->recordTranslated = FALSE;
         return FALSE;
     } else {
         $this->recordTranslated = TRUE;
     }
     foreach ($this->fieldlist as $field) {
         $this->{$field} = $this->data[$field];
     }
     if ($this->data['_LOCALIZED_UID']) {
         $this->_LOCALIZED_UID = $this->data['_LOCALIZED_UID'];
     }
     return $this->data;
 }