/** * converts an array of content elements to references, if they are references * also handles references inside fce * * @param array $tvContentArray * @param int $pid * @param int $fceUid * @return int */ protected function convertTvContentArrayToReferenceElements($tvContentArray, $pid, $fceUid = 0) { $numRecords = 0; $pid = (int) $pid; $fceUid = (int) $fceUid; foreach ($tvContentArray as $field => $contentUidString) { $contentUids = t3lib_div::trimExplode(',', $contentUidString); $position = 1; foreach ($contentUids as $contentUid) { $contentUid = (int) $contentUid; $contentElement = $this->sharedHelper->getContentElement($contentUid); $contentElementPid = (int) $contentElement['pid']; if ($this->sharedHelper->isContentElementAvailable($contentUid)) { $numRecords += $this->convertReferencesToShortcut($contentUid, $contentElementPid, $pid, $field, $position, $fceUid); ++$position; } } } return $numRecords; }