FluidTYPO3\Flux\ViewHelpers\Field\AbstractRelationFieldViewHelper::getPreparedComponent PHP Method

getPreparedComponent() protected static method

protected static getPreparedComponent ( string $type, TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface $renderingContext, array $arguments ) : FluidTYPO3\Flux\Form\RelationFieldInterface
$type string
$renderingContext TYPO3\CMS\Fluid\Core\Rendering\RenderingContextInterface
$arguments array
return FluidTYPO3\Flux\Form\RelationFieldInterface
    protected static function getPreparedComponent($type, RenderingContextInterface $renderingContext, array $arguments)
    {
        /** @var RelationFieldInterface $component */
        $component = parent::getPreparedComponent($type, $renderingContext, $arguments);
        $component->setTable($arguments['table']);
        $component->setCondition($arguments['condition']);
        $component->setManyToMany($arguments['mm']);
        $component->setForeignField($arguments['foreignField']);
        $component->setForeignSelector($arguments['foreignSelector']);
        $component->setForeignLabel($arguments['foreignLabel']);
        $component->setForeignSortby($arguments['foreignSortby']);
        $component->setForeignDefaultSortby($arguments['foreignDefaultSortby']);
        $component->setForeignTableField($arguments['foreignTableField']);
        $component->setForeignUnique($arguments['foreignUnique']);
        $component->setSymmetricField($arguments['symmetricField']);
        $component->setSymmetricLabel($arguments['symmetricLabel']);
        $component->setSymmetricSortby($arguments['symmetricSortby']);
        $component->setLocalizationMode($arguments['localizationMode']);
        $component->setLocalizeChildrenAtParentLocalization($arguments['localizeChildrenAtParentLocalization']);
        $component->setDisableMovingChildrenWithParent($arguments['disableMovingChildrenWithParent']);
        $component->setShowThumbnails($arguments['showThumbs']);
        $component->setMatchFields((array) $arguments['matchFields']);
        $component->setOppositeField($arguments['oppositeField']);
        $component->setEmptyOption($arguments['emptyOption']);
        return $component;
    }

Usage Example

 /**
  * @param string $type
  * @return RelationFieldInterface
  */
 protected function getPreparedComponent($type)
 {
     /** @var RelationFieldInterface $component */
     $component = parent::getPreparedComponent($type);
     $component->setCollapseAll($this->arguments['collapseAll']);
     $component->setExpandSingle($this->arguments['expandSingle']);
     $component->setNewRecordLinkAddTitle($this->arguments['newRecordLinkAddTitle']);
     $component->setNewRecordLinkPosition($this->arguments['newRecordLinkPosition']);
     $component->setUseCombination($this->arguments['useCombination']);
     $component->setUseSortable($this->arguments['useSortable']);
     $component->setShowPossibleLocalizationRecords($this->arguments['showPossibleLocalizationRecords']);
     $component->setShowRemovedLocalizationRecords($this->arguments['showRemovedLocalizationRecords']);
     $component->setShowAllLocalizationLink($this->arguments['showAllLocalizationLink']);
     $component->setShowSynchronizationLink($this->arguments['showSynchronizationLink']);
     if (TRUE === is_array($this->arguments['enabledControls'])) {
         $component->setEnabledControls($this->arguments['enabledControls']);
     }
     if (TRUE === is_array($this->arguments['headerThumbnail'])) {
         $component->setHeaderThumbnail($this->arguments['headerThumbnail']);
     }
     if (TRUE === is_array($this->arguments['foreignMatchFields'])) {
         $component->setForeignMatchFields($this->arguments['foreignMatchFields']);
     }
     $component->setLevelLinksPosition($this->arguments['levelLinksPosition']);
     return $component;
 }