本文整理汇总了PHP中ArrayUtil::subValueSort方法的典型用法代码示例。如果您正苦于以下问题:PHP ArrayUtil::subValueSort方法的具体用法?PHP ArrayUtil::subValueSort怎么用?PHP ArrayUtil::subValueSort使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ArrayUtil
的用法示例。
在下文中一共展示了ArrayUtil::subValueSort方法的13个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAttributesForTimeTrigger
/**
* @return sorted array
*/
public function getAttributesForTimeTrigger()
{
$attributes = $this->resolveAttributesForActionsOrTimeTriggerData(true, true, true);
$attributes = array_merge($attributes, $this->resolveDynamicallyDerivedAttributesForActionsOrTimeTriggerData(true, true, true));
$sortedAttributes = ArrayUtil::subValueSort($attributes, 'label', 'asort');
return $sortedAttributes;
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:10,代码来源:ModelRelationsAndAttributesToByTimeWorkflowAdapter.php
示例2: getAllModuleRightsDataByPermitable
/**
* @return array of all module rights data
*/
public static function getAllModuleRightsDataByPermitable(Permitable $permitable)
{
$data = array();
$modules = Module::getModuleObjects();
foreach ($modules as $module) {
if ($module instanceof SecurableModule) {
$moduleClassName = get_class($module);
$rights = $moduleClassName::getRightsNames();
$rightLabels = $moduleClassName::getTranslatedRightsLabels();
$reflectionClass = new ReflectionClass($moduleClassName);
if (!empty($rights)) {
$rightsData = array();
foreach ($rights as $right) {
if (!isset($rightLabels[$right])) {
throw new NotSupportedException($right);
}
$explicit = $permitable->getExplicitActualRight($moduleClassName, $right);
$inherited = $permitable->getInheritedActualRight($moduleClassName, $right);
$effective = $permitable->getEffectiveRight($moduleClassName, $right);
$constants = $reflectionClass->getConstants();
$constantId = array_search($right, $constants);
$rightsData[$constantId] = array('displayName' => $rightLabels[$right], 'explicit' => RightsUtil::getRightStringFromRight($explicit), 'inherited' => RightsUtil::getRightStringFromRight($inherited), 'effective' => RightsUtil::getRightStringFromRight($effective));
}
$data[$moduleClassName] = ArrayUtil::subValueSort($rightsData, 'displayName', 'asort');
}
}
}
return $data;
}
示例3: getModelAttributes
/**
* Helper function to get all model attributes as an array, that we can compare with responses from API.
* @param OwnedSecurableItem $model
* @return array
*/
public static function getModelAttributes(RedBeanModel $model)
{
$adapter = new ModelAttributesAdapter($model);
$customAttributes = ArrayUtil::subValueSort($adapter->getCustomAttributes(), 'attributeLabel', 'asort');
$standardAttributes = ArrayUtil::subValueSort($adapter->getStandardAttributes(), 'attributeLabel', 'asort');
$allAttributes = array_merge($customAttributes, $standardAttributes);
return $allAttributes;
}
示例4: getAttributesForOrderBys
/**
* @return array
*/
public function getAttributesForOrderBys()
{
$attributes = $this->getAttributesNotIncludingDerivedAttributesData();
$attributes = $this->resolveAttributesForOrderBys($attributes);
$attributes = array_merge($attributes, $this->getDynamicallyDerivedAttributesData());
$sortedAttributes = ArrayUtil::subValueSort($attributes, 'label', 'asort');
return $sortedAttributes;
}
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:11,代码来源:ModelRelationsAndAttributesToRowsAndColumnsReportAdapter.php
示例5: getAllAttributes
/**
* Get list of all index and derived attributes
* @return array of all attributes
*/
public static function getAllAttributes()
{
$contact = new Contact();
$adapter = new ContactWebFormModelAttributesAdapter($contact);
$attributes = $adapter->getAttributes();
$attributes = ArrayUtil::subValueSort($attributes, 'attributeLabel', 'asort');
return $attributes;
}
示例6: getSelectableRelationsData
/**
* @param RedBeanModel $precedingModel
* @param null $precedingRelation
* @return array|sorted
* @throws NotSupportedException
*/
public function getSelectableRelationsData(RedBeanModel $precedingModel = null, $precedingRelation = null)
{
if ($precedingModel != null && $precedingRelation == null || $precedingModel == null && $precedingRelation != null) {
throw new NotSupportedException();
}
$attributes = array();
foreach ($this->model->getAttributes() as $attribute => $notUsed) {
if ($this->model->isRelation($attribute) && !$this->rules->relationIsReportedAsAttribute($this->model, $attribute) && $this->rules->attributeIsReportable($this->model, $attribute) && !$this->relationLinksToPrecedingRelation($attribute, $precedingModel, $precedingRelation) && $this->model->isRelationTypeAHasOneVariant($attribute)) {
$this->resolveRelationToSelectableRelationData($attributes, $attribute);
}
}
$sortedAttributes = ArrayUtil::subValueSort($attributes, 'label', 'asort');
return $sortedAttributes;
}
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:20,代码来源:MergeTagsModelRelationsAndAttributesToRowsAndColumnsReportAdapter.php
示例7: getAllAttributes
/**
* Get list of all index and derived attributes that can be placed on any web form
* @return array of all attributes
*/
public static function getAllAttributes()
{
$contact = new Contact();
$adapter = new ContactWebFormModelAttributesAdapter($contact);
$attributes = $adapter->getAttributes();
$placeAbleAttributes = array();
foreach ($attributes as $attributeName => $attributeData) {
if (!$attributeData['isReadOnly'] && $attributeName != 'googleWebTrackingId') {
$placeAbleAttributes[$attributeName] = $attributeData;
}
}
$placeAbleAttributes = ArrayUtil::subValueSort($placeAbleAttributes, 'attributeLabel', 'asort');
return $placeAbleAttributes;
}
示例8: getLanguagesList
protected function getLanguagesList($languageStatus = null)
{
if (is_array($this->languagesList) && !empty($this->languagesList)) {
switch ($languageStatus) {
case self::LANGUAGE_STATUS_ACTIVE:
return $this->languagesList[self::LANGUAGE_STATUS_ACTIVE];
break;
case self::LANGUAGE_STATUS_INACTIVE:
return $this->languagesList[self::LANGUAGE_STATUS_INACTIVE];
break;
case null:
return $this->languagesList;
break;
}
}
$languagesList = array(self::LANGUAGE_STATUS_ACTIVE => array(), self::LANGUAGE_STATUS_INACTIVE => array());
$languagesData = self::getLanguagesData();
foreach ($languagesData as $languageCode => $languageData) {
if ($languageData['active']) {
$status = self::LANGUAGE_STATUS_ACTIVE;
} else {
$status = self::LANGUAGE_STATUS_INACTIVE;
}
$languagesList[$status][$languageCode] = $languageData;
}
$languagesList[self::LANGUAGE_STATUS_ACTIVE] = ArrayUtil::subValueSort($languagesList[self::LANGUAGE_STATUS_ACTIVE], 'label', 'asort');
$languagesList[self::LANGUAGE_STATUS_INACTIVE] = ArrayUtil::subValueSort($languagesList[self::LANGUAGE_STATUS_INACTIVE], 'label', 'asort');
$this->languagesList = $languagesList;
return $this->getLanguagesList($languageStatus);
}
示例9: sortCategoryItems
protected static function sortCategoryItems($categoryItems)
{
return ArrayUtil::subValueSort($categoryItems, 'titleLabel', 'asort');
}
示例10: getSelectableRelationsDataForActionTypeRelation
/**
* Exclude User relations and Owned relations.
* @return sorted array
*/
public function getSelectableRelationsDataForActionTypeRelation()
{
$attributes = array();
foreach ($this->model->getAttributes() as $attribute => $notUsed) {
if ($this->model->isRelation($attribute) && !$this->rules->relationIsUsedAsAttribute($this->model, $attribute) && $this->rules->attributeCanBeTriggered($this->model, $attribute) && !$this->model->isOwnedRelation($attribute) && $this->model->getRelationModelClassName($attribute) != 'User') {
$this->resolveRelationToSelectableRelationData($attributes, $attribute);
}
}
$attributes = array_merge($attributes, $this->getDerivedRelationsViaCastedUpModelData());
$attributes = array_merge($attributes, $this->getInferredRelationsData());
$sortedAttributes = ArrayUtil::subValueSort($attributes, 'label', 'asort');
return $sortedAttributes;
}
示例11: getAttributesForGroupBys
/**
* @return array
*/
public function getAttributesForGroupBys()
{
$attributes = array();
if ($this->shouldIncludeIdAsGroupByAttribute) {
$attributes['id'] = array('label' => Zurmo::t('Core', 'Id'));
}
$attributes = array_merge($attributes, $this->getGroupByModifierAttributes());
$attributes = array_merge($attributes, $this->getDynamicallyDerivedAttributesData());
$sortedAttributes = ArrayUtil::subValueSort($attributes, 'label', 'asort');
return $sortedAttributes;
}
示例12: processListAttributes
/**
* List all model attributes
* @param $params
* @return ApiResult
* @throws ApiException
*/
protected function processListAttributes($params)
{
$data = array();
try {
$modelClassName = $this->getModelName();
$model = new $modelClassName();
$adapter = new ModelAttributesAdapter($model);
$customAttributes = ArrayUtil::subValueSort($adapter->getCustomAttributes(), 'attributeLabel', 'asort');
$standardAttributes = ArrayUtil::subValueSort($adapter->getStandardAttributes(), 'attributeLabel', 'asort');
$allAttributes = array_merge($customAttributes, $standardAttributes);
$data['items'] = $allAttributes;
$result = new ApiResult(ApiResponse::STATUS_SUCCESS, $data, null, null);
} catch (Exception $e) {
$message = $e->getMessage();
throw new ApiException($message);
}
return $result;
}
示例13: actionModuleLayoutsList
public function actionModuleLayoutsList()
{
assert('!empty($_GET["moduleClassName"])');
$moduleClassName = $_GET['moduleClassName'];
$module = new $_GET['moduleClassName'](null, null);
$modelClassName = $moduleClassName::getPrimaryModelName();
$model = new $modelClassName();
$viewClassNames = $moduleClassName::getViewClassNames();
$editableViewsCollection = array();
foreach ($viewClassNames as $className) {
$classToEvaluate = new ReflectionClass($className);
if (is_subclass_of($className, 'MetadataView') && !$classToEvaluate->isAbstract() && $className::getDesignerRulesType() != null) {
$designerRulesType = $className::getDesignerRulesType();
$designerRulesClassName = $designerRulesType . 'DesignerRules';
$designerRules = new $designerRulesClassName();
if ($designerRules->allowEditInLayoutTool()) {
$editableViewsCollection[] = array('titleLabel' => $designerRules->resolveDisplayNameByView($className), 'route' => '/designer/default/layoutEdit', 'viewClassName' => $className);
}
}
}
$editableViewsCollection = ArrayUtil::subValueSort($editableViewsCollection, 'titleLabel', 'asort');
$title = $moduleClassName::getModuleLabelByTypeAndLanguage('Plural') . ': ' . Zurmo::t('DesignerModule', 'Layouts');
$breadcrumbLinks = array($title);
$canvasView = new ActionBarAndModuleEditableMetadataCollectionView($this->getId(), $this->getModule()->getId(), $module, $moduleClassName::getModuleLabelByTypeAndLanguage('Plural'), $editableViewsCollection, $title);
$view = new DesignerPageView(ZurmoDefaultAdminViewUtil::makeViewWithBreadcrumbsForCurrentUser($this, $canvasView, $breadcrumbLinks, 'DesignerBreadCrumbView'));
echo $view->render();
}