Contao\FileTree::__construct PHP Method

__construct() public method

Load the database object
public __construct ( array $arrAttributes = null )
$arrAttributes array
    public function __construct($arrAttributes = null)
    {
        $this->import('Database');
        parent::__construct($arrAttributes);
        // Prepare the order field
        if ($this->orderField != '') {
            $this->strOrderId = $this->orderField . str_replace($this->strField, '', $this->strId);
            $this->strOrderName = $this->orderField . str_replace($this->strField, '', $this->strName);
            // Retrieve the order value
            $objRow = $this->Database->prepare("SELECT {$this->orderField} FROM {$this->strTable} WHERE id=?")->limit(1)->execute($this->activeRecord->id);
            $tmp = \StringUtil::deserialize($objRow->{$this->orderField});
            $this->{$this->orderField} = !empty($tmp) && is_array($tmp) ? array_filter($tmp) : array();
        }
    }