本文整理汇总了PHP中X2Model::Model方法的典型用法代码示例。如果您正苦于以下问题:PHP X2Model::Model方法的具体用法?PHP X2Model::Model怎么用?PHP X2Model::Model使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类X2Model
的用法示例。
在下文中一共展示了X2Model::Model方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getModelTypesWhichSupportWorkflow
/**
* Like getModelTypes () except that only types of models which support workflow are
* returned
* @param boolean $assoc
* @return array
*/
public static function getModelTypesWhichSupportWorkflow($assoc = false, $associationTypes = false)
{
$modelTypes = self::getModelTypes($assoc);
$tmp = $assoc ? array_flip($modelTypes) : $modelTypes;
$tmp = array_filter($tmp, function ($a) use($assoc) {
return X2Model::Model($a)->supportsWorkflow;
});
$tmp = $assoc ? array_flip($tmp) : $tmp;
$tmp = array_intersect($modelTypes, $tmp);
if ($associationTypes) {
$arr = array();
foreach ($tmp as $k => $v) {
if ($assoc) {
$arr[X2Model::getAssociationType($k)] = $v;
} else {
$arr[] = X2Model::getAssociationType($v);
}
}
$tmp = $arr;
}
return $tmp;
}
示例2: getModelTypesWhichSupportWorkflow
/**
* Like getModelTypes () except that only types of models which support workflow are
* returned
* @param boolean $assoc
* @return array
*/
public static function getModelTypesWhichSupportWorkflow($assoc = false)
{
$modelTypes = self::getModelTypes($assoc);
$tmp = $assoc ? array_flip($modelTypes) : $modelTypes;
$tmp = array_filter($tmp, function ($a) use($assoc) {
return X2Model::Model($a)->supportsWorkflow;
});
$tmp = $assoc ? array_flip($tmp) : $tmp;
return array_intersect($modelTypes, $tmp);
}