本文整理汇总了PHP中Activity::setType方法的典型用法代码示例。如果您正苦于以下问题:PHP Activity::setType方法的具体用法?PHP Activity::setType怎么用?PHP Activity::setType使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Activity
的用法示例。
在下文中一共展示了Activity::setType方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: createFromXML
/**
* Convert the raw XML into an object
*
* @param \SimpleXMLElement $xml
* @return Activity
*/
public static function createFromXML(\SimpleXMLElement $xml)
{
$activity = new Activity();
if (isset($xml->attributes()['count'])) {
$activity->setCount((int) $xml->attributes()['count']);
}
if (isset($xml->attributes()['type'])) {
$activity->setType((string) $xml->attributes()['type']);
}
return $activity;
}
示例2: getActivity
function getActivity($activity_id)
{
$query = "select * from `" . GALAXIA_TABLE_PREFIX . "activities` where `activity_id`=?";
$result = $this->mDb->query($query, array($activity_id));
if (!$result->numRows()) {
return false;
}
$res = $result->fetchRow();
switch ($res['act_type']) {
case 'start':
$act = new Start();
break;
case 'end':
$act = new End();
break;
case 'join':
$act = new Join();
break;
case 'split':
$act = new Split();
break;
case 'standalone':
$act = new Standalone();
break;
case 'switch':
$act = new SwitchActivity();
break;
case 'activity':
$act = new Activity();
break;
default:
trigger_error('Unknown activity type:' . $res['act_type'], E_USER_WARNING);
}
$act->setName($res['name']);
$act->setProcessId($res['p_id']);
$act->setNormalizedName($res['normalized_name']);
$act->setDescription($res['description']);
$act->setIsInteractive($res['is_interactive']);
$act->setIsAutoRouted($res['is_auto_routed']);
$act->setActivityId($res['activity_id']);
$act->setType($res['act_type']);
//Now get forward transitions
//Now get backward transitions
//Now get roles
$query = "select `role_id` from `" . GALAXIA_TABLE_PREFIX . "activity_roles` where `activity_id`=?";
$result = $this->mDb->query($query, array($res['activity_id']));
while ($res = $result->fetchRow()) {
$this->roles[] = $res['role_id'];
}
$act->setRoles($this->roles);
return $act;
}
示例3: fire
/**
* This function never fails.
*/
protected static function fire($type)
{
try {
$activity = new Activity();
try {
$activity->setProfileId(UserHelper::getProfileId());
} catch (fException $e) {
$activity->setProfileId(NULL);
}
$activity->setRealname(UserHelper::getDisplayName());
$activity->setType($type);
$activity->store();
} catch (Exception $e) {
// do nothing
}
}
示例4: listActivities
/**
* Public function that Gets a list of first 50 Activities in the account
*
* @return array $allActivities - array of two arrays, array 1 is activity objects, array 2 is link for next 50 activities
*/
public function listActivities()
{
$utility = new Utility();
$return = $utility->httpGet($utility->getApiPath() . '/ws/customers/'. $utility->getLogin() .'/activities');
$allActivities = array();
$activityList = array();
$pages = array();
$parsedReturn = simplexml_load_string($return['xml']);
foreach ($parsedReturn->entry as $item)
{
$activity = new Activity();
$activity->setLink($item->link['href']);
$activity->setId($item->id);
$activity->setActivityTitle($item->content->title);
$activity->setType($item->content->Activity->Type);
$activity->setStatus($item->content->Activity->Status);
$activity->setTransactionCount($item->content->Activity->TransactionCount);
$activity->setErrorCount($item->content->Activity->Errors);
$activity->setRunStartTime($item->content->Activity->RunStartTime);
$activity->setRunFinishTime($item->content->Activity->RunFinishTime);
$activity->setInsertTime($item->content->Activity->InsertTime);
$activityList[] = $activity;
}
if ($parsedReturn->link[2])
{
$pages[] = $parsedReturn->link[2]->Attributes()->href;
}
$allActivities = array($activityList, $pages);
return $allActivities;
}