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


PHP Activity::setId方法代码示例

本文整理汇总了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());
开发者ID:raigons,项目名称:bureauinteligencia,代码行数:31,代码来源:subscribe-user.php

示例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;
		}
开发者ID:ryannmicua,项目名称:Pogidude-Hybrid,代码行数:42,代码来源:ctctWrapper.php


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