当前位置: 首页>>代码示例>>PHP>>正文


PHP Activity::getMetadata方法代码示例

本文整理汇总了PHP中Activity::getMetadata方法的典型用法代码示例。如果您正苦于以下问题:PHP Activity::getMetadata方法的具体用法?PHP Activity::getMetadata怎么用?PHP Activity::getMetadata使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Activity的用法示例。


在下文中一共展示了Activity::getMetadata方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1: addRelatedModelAccountToModel

 /**
  * Copy the account from a related model to a activity items
  * @param RedBeanModel $model
  * @param RedBeanModel $relatedModel
  */
 protected function addRelatedModelAccountToModel(RedBeanModel $model, RedBeanModel $relatedModel)
 {
     $metadata = Activity::getMetadata();
     if ($relatedModel->isRelation('account') && isset($relatedModel->account) && $relatedModel->account->id > 0 && in_array(get_class($relatedModel->account), $metadata['Activity']['activityItemsModelClassNames'])) {
         $model->activityItems->add($relatedModel->account);
     }
 }
开发者ID:KulturedKitsch,项目名称:kulturedkitsch.info,代码行数:12,代码来源:ActivitiesModuleController.php

示例2: init

 public function init()
 {
     $metadata = Activity::getMetadata();
     $observedModelClassNames = $metadata['Activity']['activityItemsModelClassNames'];
     if ($observedModelClassNames == null) {
         return;
     }
     foreach ($observedModelClassNames as $modelClassName) {
         $modelClassName::model()->attachEventHandler('onAfterDelete', array($this, 'deleteActivityItems'));
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:11,代码来源:ActivitiesObserver.php

示例3: canUserPerformAction

 /**
  * Runs through relations and makes sure the user can access at least one relation. If at least one is
  * accessible, true is returned.
  */
 public function canUserPerformAction()
 {
     $metadata = Activity::getMetadata();
     foreach ($metadata['Activity']['activityItemsModelClassNames'] as $modelClassName) {
         if (is_subclass_of($modelClassName, 'Item') && $modelClassName::getModuleClassName() != null) {
             if (RightsUtil::canUserAccessModule($modelClassName::getModuleClassName(), $this->user)) {
             }
             return true;
         }
     }
     return false;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:16,代码来源:ActivityItemsModalListActionSecurity.php

示例4: resolveNewModelByRelationInformation

 /**
  * Override to handle the special scenario of relations for an activity. Since relations are done in the
  * ActivityItems, the relation information needs to handled in a specific way.
  * @see ZurmoModuleController->resolveNewModelByRelationInformation
  */
 protected function resolveNewModelByRelationInformation($model, $relationModelClassName, $relationModelId, $relationModuleId)
 {
     assert('$model instanceof Activity');
     assert('is_string($relationModelClassName)');
     assert('is_int($relationModelId)');
     assert('is_string($relationModuleId)');
     $metadata = Activity::getMetadata();
     if (in_array($relationModelClassName, $metadata['Activity']['activityItemsModelClassNames'])) {
         $model->activityItems->add($relationModelClassName::getById((int) $relationModelId));
     } else {
         throw new NotSupportedException();
     }
     return $model;
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:19,代码来源:ActivitiesModuleController.php

示例5: getActivityItemsDerivedAttributeTypesAndResolveAccessByCurrentUser

 protected static function getActivityItemsDerivedAttributeTypesAndResolveAccessByCurrentUser()
 {
     $metadata = Activity::getMetadata();
     $derivedAttributeTypes = array();
     $activityItemsModelClassNames = $metadata['Activity']['activityItemsModelClassNames'];
     foreach ($activityItemsModelClassNames as $modelClassName) {
         $moduleClassName = $modelClassName::getModuleClassName();
         if (RightsUtil::canUserAccessModule($moduleClassName, Yii::app()->user->userModel)) {
             $derivedAttributeTypes[] = $modelClassName . 'Derived';
         }
         //todo: add support for leads.
     }
     return $derivedAttributeTypes;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:14,代码来源:ActivitiesImportRules.php

示例6: resolveCustomMetadataAndLoad

 public static function resolveCustomMetadataAndLoad()
 {
     $shouldSaveZurmoModuleMetadata = false;
     $metadata = ZurmoModule::getMetadata();
     if (!in_array('animals', $metadata['global']['tabMenuItemsModuleOrdering'])) {
         $metadata['global']['tabMenuItemsModuleOrdering'][] = 'animals';
         $shouldSaveZurmoModuleMetadata = true;
     }
     if ($shouldSaveZurmoModuleMetadata) {
         ZurmoModule::setMetadata($metadata);
         GeneralCache::forgetAll();
     }
     $metadata = Activity::getMetadata();
     if (!in_array('Animal', $metadata['Activity']['activityItemsModelClassNames'])) {
         $metadata['Activity']['activityItemsModelClassNames'][] = 'Animal';
         Activity::setMetadata($metadata);
         GeneralCache::forgetAll();
     }
     Yii::import('application.extensions.zurmoinc.framework.data.*');
     Yii::import('application.modules.animals.data.*');
     $defaultDataMaker = new AnimalsDefaultDataMaker();
     $defaultDataMaker->make();
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:23,代码来源:ZurmoZooInstallUtil.php

示例7: renderRelatedModelsByImportanceContent

 /**
  * Renders related models. But only renders one type of related model given that the $model supplied
  * is connected to more than one type of activity item.  There is an order of importance that is checked
  * starting with Account, then Contact, then Opportunity. If none are found, then it grabs the first available.
  * @see getActivityItemsStringContentByModelClassName
  * @param RedBeanModel $model
  */
 public function renderRelatedModelsByImportanceContent(RedBeanModel $model)
 {
     if ($model->activityItems->count() == 0) {
         return;
     }
     $stringContent = self::getActivityItemsStringContentByModelClassName($model, 'Account');
     if ($stringContent != null) {
         return Zurmo::t('ActivitiesModule', 'for {relatedModelsStringContent}', array('{relatedModelsStringContent}' => $stringContent));
     }
     $stringContent = self::getActivityItemsStringContentByModelClassName($model, 'Contact', 'ContactsStateMetadataAdapter');
     if ($stringContent != null) {
         return Zurmo::t('ActivitiesModule', 'with {relatedContactsStringContent}', array('{relatedContactsStringContent}' => $stringContent));
     }
     $stringContent = self::getActivityItemsStringContentByModelClassName($model, 'Opportunity');
     if ($stringContent != null) {
         return Zurmo::t('ActivitiesModule', 'for {relatedModelsStringContent}', array('{relatedModelsStringContent}' => $stringContent));
     }
     $metadata = Activity::getMetadata();
     $stringContent = self::getFirstActivityItemStringContent($metadata['Activity']['activityItemsModelClassNames'], $model);
     if ($stringContent != null) {
         return Zurmo::t('ActivitiesModule', 'for {relatedModelsStringContent}', array('{relatedModelsStringContent}' => $stringContent));
     }
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:30,代码来源:ActivityMashableActivityRules.php

示例8: getActivityItemsModelClassNames

 public static function getActivityItemsModelClassNames()
 {
     $metadata = Activity::getMetadata();
     return $metadata['Activity']['activityItemsModelClassNames'];
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:5,代码来源:ActivitiesUtil.php

示例9: getRelatedItemsModelClassNames

 protected static function getRelatedItemsModelClassNames()
 {
     $metadata = Activity::getMetadata();
     return $metadata['Activity']['activityItemsModelClassNames'];
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:5,代码来源:ActivityItemsElement.php

示例10: __construct

 public function __construct($relationModel)
 {
     $metadata = Activity::getMetadata();
     assert('in_array(get_class($relationModel), $metadata["Activity"]["activityItemsModelClassNames"])');
     parent::__construct($relationModel);
 }
开发者ID:RamaKavanan,项目名称:InitialVersion,代码行数:6,代码来源:ActivityItemForm.php

示例11: getActivityItemsModelClassNamesDataExcludingContacts

 public static function getActivityItemsModelClassNamesDataExcludingContacts()
 {
     $metadata = Activity::getMetadata();
     $activityItemsModelClassNamesData = $metadata['Activity']['activityItemsModelClassNames'];
     foreach ($activityItemsModelClassNamesData as $index => $relationModelClassName) {
         if ($relationModelClassName == 'Contact') {
             unset($activityItemsModelClassNamesData[$index]);
         }
     }
     return $activityItemsModelClassNamesData;
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:11,代码来源:ActivitiesUtil.php


注:本文中的Activity::getMetadata方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。