Пример #1
0
 /**
  * Processes a single field of a moved record and follows references.
  *
  * @param DataHandler $dataHandler Calling DataHandler instance
  * @param int $resolvedPageId Resolved real destination page id
  * @param string $table Name of parent table
  * @param int $uid UID of the parent record
  * @param string $field Name of the field of the parent record
  * @param string $value Value of the field of the parent record
  * @param array $configuration TCA field configuration of the parent record
  * @return void
  */
 protected function moveRecord_processFieldValue(DataHandler $dataHandler, $resolvedPageId, $table, $uid, $field, $value, array $configuration)
 {
     $inlineFieldType = $dataHandler->getInlineFieldType($configuration);
     $inlineProcessing = ($inlineFieldType === 'list' || $inlineFieldType === 'field') && BackendUtility::isTableMovePlaceholderAware($configuration['foreign_table']) && (!isset($configuration['behaviour']['disableMovingChildrenWithParent']) || !$configuration['behaviour']['disableMovingChildrenWithParent']);
     if ($inlineProcessing) {
         if ($table === 'pages') {
             // If the inline elements are related to a page record,
             // make sure they reside at that page and not at its parent
             $resolvedPageId = $uid;
         }
         $dbAnalysis = $this->createRelationHandlerInstance();
         $dbAnalysis->start($value, $configuration['foreign_table'], '', $uid, $table, $configuration);
         // Moving records to a positive destination will insert each
         // record at the beginning, thus the order is reversed here:
         foreach ($dbAnalysis->itemArray as $item) {
             $versionedRecord = BackendUtility::getWorkspaceVersionOfRecord($dataHandler->BE_USER->workspace, $item['table'], $item['id'], 'uid,t3ver_state');
             if (empty($versionedRecord) || VersionState::cast($versionedRecord['t3ver_state'])->indicatesPlaceholder()) {
                 continue;
             }
             $dataHandler->moveRecord($item['table'], $item['id'], $resolvedPageId);
         }
     }
 }