本文整理汇总了PHP中Gdn_DataSet::datasetType方法的典型用法代码示例。如果您正苦于以下问题:PHP Gdn_DataSet::datasetType方法的具体用法?PHP Gdn_DataSet::datasetType怎么用?PHP Gdn_DataSet::datasetType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Gdn_DataSet
的用法示例。
在下文中一共展示了Gdn_DataSet::datasetType方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: __get
/**
* Create some virtual properties.
*
* @param $Name
* @return Gdn_DataSet
*/
public function __get($Name)
{
switch ($Name) {
case 'CommentData':
Deprecated('ActivityController->CommentData', "ActivityController->data('Activities')");
$Result = new Gdn_DataSet(array(), DATASET_TYPE_OBJECT);
return $Result;
case 'ActivityData':
Deprecated('ActivityController->ActivityData', "ActivityController->data('Activities')");
$Result = new Gdn_DataSet($this->data('Activities'), DATASET_TYPE_ARRAY);
$Result->datasetType(DATASET_TYPE_OBJECT);
return $Result;
}
}
示例2: getData
/**
* Get the data for this module.
*/
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;
}