src/Contao/View/Contao2BackendView/TreePicker.php
protected function setUp(General $dataContainer = null)
    {
        $this->dataContainer = $dataContainer ?: $this->objDca;

        if (!$this->dataContainer) {
            return;
        }

        $environment = $this->dataContainer->getEnvironment();

        if (!$this->sourceName) {
            $property = $environment
                ->getDataDefinition()
                ->getPropertiesDefinition()
                ->getProperty($environment->getInputProvider()->getValue('name'));

            foreach ($property->getExtra() as $k => $v) {
                $this->$k = $v;
            }

            $name           = $environment->getInputProvider()->getValue('name');
            $this->strField = $name;
            $this->strName  = $name;
            $this->strId    = $name;
            $this->label    = $property->getLabel() ?: $name;
            $this->strTable = $environment->getDataDefinition()->getName();
        }

        $this->itemContainer = (new DcGeneralFactory())
            ->setContainerName($this->sourceName)
            ->setTranslator($environment->getTranslator())
            ->setEventDispatcher($environment->getEventDispatcher())
            ->createDcGeneral();
    }
protected function setUp(General $dataContainer = null)
    {
        $this->dataContainer = $dataContainer ?: $this->objDca;

        if (!$this->dataContainer) {
            return;
        }

        $environment = $this->dataContainer->getEnvironment();

        if (!$this->sourceName) {
            $property = $environment
                ->getDataDefinition()
                ->getPropertiesDefinition()
                ->getProperty($environment->getInputProvider()->getValue('name'));

            foreach ($property->getExtra() as $k => $v) {
                $this->$k = $v;
            }

            $name           = $environment->getInputProvider()->getValue('name');
            $this->strField = $name;
            $this->strName  = $name;
            $this->strId    = $name;
            $this->label    = $property->getLabel() ?: $name;
            $this->strTable = $environment->getDataDefinition()->getName();
        }

        $this->itemContainer = (new DcGeneralFactory())
            ->setContainerName($this->sourceName)
            ->setTranslator($environment->getTranslator())
            ->setEventDispatcher($environment->getEventDispatcher())
            ->createDcGeneral();
    }
protected function setUp ( General $ dataContainer = null ) { $ this -> dataContainer = $ dataContainer ? : $ this -> objDca ; if ( ! $ this -> dataContainer ) { return ; } $ environment = $ this -> dataContainer -> getEnvironment ( ) ; if ( ! $ this -> sourceName ) { $ property = $ environment -> getDataDefinition ( ) -> getPropertiesDefinition ( ) -> getProperty ( $ environment -> getInputProvider ( ) -> getValue ( 'name' ) ) ; foreach ( $ property -> getExtra ( ) as $ k => $ v ) { $ this -> $ k = $ v ; } $ name = $ environment -> getInputProvider ( ) -> getValue ( 'name' ) ; $ this -> strField = $ name ; $ this -> strName = $ name ; $ this -> strId = $ name ; $ this -> label = $ property -> getLabel ( ) ? : $ name ; $ this -> strTable = $ environment -> getDataDefinition ( ) -> getName ( ) ; } $ this -> itemContainer = ( new DcGeneralFactory ( ) ) -> setContainerName ( $ this -> sourceName ) -> setTranslator ( $ environment -> getTranslator ( ) ) -> setEventDispatcher ( $ environment -> getEventDispatcher ( ) ) -> createDcGeneral ( ) ; }
Setup all local values and create the dc instance for the referenced data source.

@param General $dataContainer The data container to use.

@return void
Setup all local values and create the dc instance for the referenced data source .