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


PHP Workflow::getModuleClassName方法代码示例

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


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

示例1: getData

 /**
  * @param string $nodeId
  * @return array
  */
 public function getData($nodeId)
 {
     assert('is_string($nodeId)');
     $nodeId = $this->resolveNodeIdByRemovingTreeType($nodeId);
     $moduleClassName = $this->workflow->getModuleClassName();
     $modelToWorkflowAdapter = $this->makeModelRelationsAndAttributesToWorkflowAdapter($moduleClassName, $moduleClassName::getPrimaryModelName());
     $nodeIdPrefix = self::resolveNodeIdPrefixByNodeId($nodeId);
     $precedingModel = null;
     $precedingRelation = null;
     if ($nodeId != 'source') {
         self::resolvePrecedingModelRelationAndAdapterByNodeId($nodeId, $modelToWorkflowAdapter, $precedingModel, $precedingRelation);
     } else {
         $nodeIdPrefix = null;
     }
     if ($nodeIdPrefix == null) {
         $data = array();
         $data[0] = array('expanded' => true, 'text' => $moduleClassName::getModuleLabelByTypeAndLanguage('Singular'));
     }
     $childrenNodeData = $this->getChildrenNodeData($modelToWorkflowAdapter, $precedingModel, $precedingRelation, $nodeIdPrefix);
     if (!empty($childrenNodeData) && $nodeIdPrefix == null) {
         $data[0]['children'] = $childrenNodeData;
     } else {
         $data = $childrenNodeData;
     }
     return $data;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:30,代码来源:WorkflowRelationsAndAttributesToTreeAdapter.php

示例2: setCommonAttributes

 /**
  * @param WorkflowWizardForm $formModel
  */
 protected function setCommonAttributes(WorkflowWizardForm $formModel)
 {
     $formModel->id = $this->workflow->getId();
     $formModel->isActive = $this->workflow->getIsActive();
     $formModel->description = $this->workflow->getDescription();
     $formModel->moduleClassName = $this->workflow->getModuleClassName();
     $formModel->name = $this->workflow->getName();
     $formModel->triggerOn = $this->workflow->getTriggerOn();
     $formModel->type = $this->workflow->getType();
     $formModel->triggersStructure = $this->workflow->getTriggersStructure();
     $formModel->timeTriggerAttribute = $this->workflow->getTimeTriggerAttribute();
     if ($this->workflow->isNew()) {
         $formModel->setIsNew();
     }
     $formModel->timeTrigger = $this->workflow->getTimeTrigger();
     $formModel->triggers = $this->workflow->getTriggers();
     $formModel->actions = $this->workflow->getActions();
     $formModel->emailMessages = $this->workflow->getEmailMessages();
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:22,代码来源:WorkflowToWizardFormAdapter.php

示例3: makeEmailMessageForWorkflowFormByQueueModelAndWorkflow

 /**
  * @param WorkflowMessageInQueue $workflowMessageInQueue
  * @param Workflow $workflow
  * @return EmailMessageForWorkflowForm
  */
 public static function makeEmailMessageForWorkflowFormByQueueModelAndWorkflow(WorkflowMessageInQueue $workflowMessageInQueue, Workflow $workflow)
 {
     $moduleClassName = $workflow->getModuleClassName();
     $emailMessageForWorkflowForm = new EmailMessageForWorkflowForm($moduleClassName::getPrimaryModelName(), $workflow->getType(), 0);
     $unserializedData = unserialize($workflowMessageInQueue->serializedData);
     $emailMessageForWorkflowForm->setAttributes(reset($unserializedData));
     return $emailMessageForWorkflowForm;
 }
开发者ID:maruthisivaprasad,项目名称:zurmo,代码行数:13,代码来源:WorkflowEmailMessagesUtil.php

示例4: resolveTimeTrigger

 /**
  * No need to sanitize for Date and DateTime since those attributes utilize integers for time-based triggers
  * @param array $data
  * @param Workflow $workflow
  */
 public static function resolveTimeTrigger($data, Workflow $workflow)
 {
     assert('is_array($data)');
     if ($workflow->getType() != Workflow::TYPE_BY_TIME) {
         return;
     }
     $workflow->removeTimeTrigger();
     $moduleClassName = $workflow->getModuleClassName();
     $timeTrigger = new TimeTriggerForWorkflowForm($moduleClassName, $moduleClassName::getPrimaryModelName(), $workflow->getType());
     if (null != ($timeTriggerData = ArrayUtil::getArrayValue($data, ComponentForWorkflowForm::TYPE_TIME_TRIGGER))) {
         $timeTrigger->setAttributes($timeTriggerData);
     }
     $workflow->setTimeTrigger($timeTrigger);
 }
开发者ID:sandeep1027,项目名称:zurmo_,代码行数:19,代码来源:DataToWorkflowUtil.php

示例5: testSetAndGetWorkflow

 /**
  * @depends testGetWorkflowSupportedModulesClassNamesCurrentUserHasAccessTo
  */
 public function testSetAndGetWorkflow()
 {
     $timeTrigger = new TimeTriggerForWorkflowForm('WorkflowsTestModule', 'WorkflowModelTestItem', Workflow::TYPE_ON_SAVE);
     $action = new ActionForWorkflowForm('WorkflowModelTestItem', Workflow::TYPE_ON_SAVE);
     $emailMessage = new EmailMessageForWorkflowForm('WorkflowModelTestItem', Workflow::TYPE_ON_SAVE);
     $trigger = new TriggerForWorkflowForm('WorkflowsTestModule', 'WorkflowModelTestItem', Workflow::TYPE_ON_SAVE);
     $workflow = new Workflow();
     $workflow->setModuleClassName('SomeModule');
     $workflow->setDescription('a description');
     $workflow->setTriggersStructure('1 AND 2');
     $workflow->setTimeTriggerAttribute('something');
     $workflow->setId(5);
     $workflow->setIsActive(true);
     $workflow->setOrder(6);
     $workflow->setName('my workflow rule');
     $workflow->setTriggerOn(Workflow::TRIGGER_ON_NEW);
     $workflow->setType(Workflow::TYPE_ON_SAVE);
     $workflow->setTimeTrigger($timeTrigger);
     $workflow->addTrigger($trigger);
     $workflow->addAction($action);
     $workflow->addEmailMessage($emailMessage);
     $this->assertEquals('SomeModule', $workflow->getModuleClassName());
     $this->assertEquals('a description', $workflow->getDescription());
     $this->assertEquals('1 AND 2', $workflow->getTriggersStructure());
     $this->assertEquals('something', $workflow->getTimeTriggerAttribute());
     $this->assertEquals(5, $workflow->getId());
     $this->assertTrue($workflow->getIsActive());
     $this->assertEquals(6, $workflow->getOrder());
     $this->assertEquals('my workflow rule', $workflow->getName());
     $this->assertEquals(Workflow::TRIGGER_ON_NEW, $workflow->getTriggerOn());
     $this->assertEquals(Workflow::TYPE_ON_SAVE, $workflow->getType());
     $this->assertEquals($timeTrigger, $workflow->getTimeTrigger());
     $actions = $workflow->getActions();
     $this->assertEquals($action, $actions[0]);
     $this->assertCount(1, $actions);
     $emailMessages = $workflow->getEmailMessages();
     $this->assertEquals($emailMessage, $emailMessages[0]);
     $this->assertCount(1, $emailMessages);
     $triggers = $workflow->getTriggers();
     $this->assertEquals($trigger, $triggers[0]);
     $this->assertCount(1, $triggers);
     $workflow->removeAllActions();
     $actions = $workflow->getActions();
     $this->assertCount(0, $actions);
     $workflow->removeAllEmailMessages();
     $emailMessages = $workflow->getEmailMessages();
     $this->assertCount(0, $emailMessages);
     $workflow->removeAllTriggers();
     $triggers = $workflow->getTriggers();
     $this->assertCount(0, $triggers);
     $workflow->removeTimeTrigger();
     $this->assertNull($workflow->getTimeTrigger());
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:56,代码来源:WorkflowTest.php

示例6: makeEmailMessageForWorkflowFormAndPopulateWorkflowFromData

 /**
  * @param array $componentFormsData
  * @param Workflow $workflow
  */
 protected static function makeEmailMessageForWorkflowFormAndPopulateWorkflowFromData($componentFormsData, Workflow $workflow)
 {
     assert('is_array($componentFormsData)');
     $moduleClassName = $workflow->getModuleClassName();
     $rowKey = 0;
     foreach ($componentFormsData as $componentFormData) {
         $component = new EmailMessageForWorkflowForm($moduleClassName::getPrimaryModelName(), $workflow->getType(), $rowKey);
         $component->setAttributes($componentFormData);
         $workflow->addEmailMessage($component);
         $rowKey++;
     }
 }
开发者ID:youprofit,项目名称:Zurmo,代码行数:16,代码来源:SavedWorkflowToWorkflowAdapter.php


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