本文整理汇总了PHP中Activity::setId方法的典型用法代码示例。如果您正苦于以下问题:PHP Activity::setId方法的具体用法?PHP Activity::setId怎么用?PHP Activity::setId使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Activity
的用法示例。
在下文中一共展示了Activity::setId方法的2个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: City
<?php
if (RequestsPatterns::postParamsSetted('email', 'name', 'username', 'password', 'confirm_password', 'city', 'activity')) {
if (RequestsPatterns::postParamsSent('email', 'name', 'username', 'password', 'confirm_password', 'city', 'activity')) {
require_once 'UserController.php';
require_once 'UserDao.php';
require_once '../core/generics/City.php';
require_once '../core/generics/Activity.php';
$city = new City(null, $_POST['city']);
$activity = new Activity();
$activity->setId($_POST['activity']);
$user = new User($_POST['name'], $_POST['username'], $_POST['password']);
$user->setEmail($_POST['email']);
$user->setCity($city);
$user->setActivity($activity);
$positions = 'noticias,metereologia|publicacoes,videoteca|cotacoes';
$user->setPositions($positions);
$userController = new UserController(new UserDao(Connection::connect()));
try {
if ($userController->subscribe($user, $_POST['confirm_password'])) {
$jsonResponse = new JsonResponse();
print_r($jsonResponse->response(true, 'Usuário cadastrado com sucesso. Você será automaticamente conectado ao sistema')->addValue("redirectTo", LinkController::getBaseURL())->serialize());
Session::login($user);
//header('Location: '.LinkController::getBaseURL());
} else {
$jsonResponse = new JsonResponse();
print_r($jsonResponse->response(false, 'Falha no cadastro do usuário. Favor tentar novamente')->serialize());
}
} catch (Exception $err) {
$jsonResponse = new JsonResponse();
print_r($jsonResponse->response(false, $err->getMessage())->serialize());
示例2: 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;
}