CategoriesModule::getData PHP 메소드

getData() 보호된 메소드

Get the data for this module.
protected getData ( )
    protected function getData()
    {
        // Allow plugins to set different data.
        $this->fireEvent('GetData');
        if ($this->Data) {
            return;
        }
        $categoryModel = new CategoryModel();
        $Categories = $categoryModel->setJoinUserCategory(true)->getChildTree(null);
        $Categories = CategoryModel::flattenTree($Categories);
        $Categories2 = $Categories;
        // Filter out the categories we aren't watching.
        foreach ($Categories2 as $i => $Category) {
            if (!$Category['PermsDiscussionsView'] || !$Category['Following']) {
                unset($Categories[$i]);
            }
        }
        $Data = new Gdn_DataSet($Categories, DATASET_TYPE_ARRAY);
        $Data->datasetType(DATASET_TYPE_OBJECT);
        $this->Data = $Data;
    }