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


PHP Application::getId方法代码示例

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


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

示例1: getAppInstallDate

 public function getAppInstallDate(Application $app, $format = null)
 {
     $install_apps = $this->getInstallApps();
     if (isset($install_apps[$app->getId()])) {
         return $install_apps[$app->getId()]->getLastInstalled();
     }
     return null;
 }
开发者ID:kzfk,项目名称:emlauncher,代码行数:8,代码来源:User.php

示例2: hasApplicationAnswers

 /**
  * Check if a page has any answers associated with it for a specific application
  * @param Page $page
  * @param Application $application
  * @return boolean
  */
 public function hasApplicationAnswers(Page $page, Application $application)
 {
     $query = $this->_em->createQuery('SELECT COUNT(answer.id) as ancnt FROM Jazzee\\Entity\\Answer answer JOIN answer.applicant applicant WHERE answer.page = :pageId AND applicant.application = :applicationId');
     $query->setParameter('pageId', $page->getId());
     $query->setParameter('applicationId', $application->getId());
     $result = $query->getResult();
     return $result[0]['ancnt'] > 0;
 }
开发者ID:Jazzee,项目名称:Jazzee,代码行数:14,代码来源:PageRepository.php

示例3: getNavigation

 /**
  * Get the navigation
  * @return Navigation
  */
 public function getNavigation()
 {
     if (empty($this->program) and empty($this->application)) {
         return null;
     }
     $navigation = new \Foundation\Navigation\Container();
     $menu = new \Foundation\Navigation\Menu();
     $menu->setTitle('Navigation');
     if (empty($this->application)) {
         $link = new \Foundation\Navigation\Link('Welcome');
         $link->setHref($this->path('apply'));
         $menu->addLink($link);
     } else {
         $path = 'apply/' . $this->program->getShortName() . '/' . $this->cycle->getName();
         $link = new \Foundation\Navigation\Link('Welcome');
         $link->setHref($this->path($path));
         $link->setCurrent(true);
         $menu->addLink($link);
         //Only show the other cycles link if there are other published visible cycles
         $applications = $this->_em->getRepository('Jazzee\\Entity\\Application')->findByProgram($this->program, false, true, array($this->application->getId()));
         if (count($applications) > 0) {
             $link = new \Foundation\Navigation\Link('Other Cycles');
             $link->setHref($this->path('apply/' . $this->program->getShortName()));
             $menu->addLink($link);
         }
         $link = new \Foundation\Navigation\Link('Returning Applicants');
         $link->setHref($this->path($path . '/applicant/login'));
         $menu->addLink($link);
         if (!$this->application->isByInvitationOnly()) {
             $link = new \Foundation\Navigation\Link('Start a New Application');
             $link->addClass('highlight');
             $link->setHref($this->path($path . '/applicant/new'));
             $menu->addLink($link);
         }
     }
     $navigation->addMenu($menu);
     if ($this->isPreviewMode()) {
         $menu = new \Foundation\Navigation\Menu();
         $navigation->addMenu($menu);
         $menu->setTitle('Preview Functions');
         $link = new \Foundation\Navigation\Link('Become Administrator');
         $link->setHref($this->path('admin/login'));
         $menu->addLink($link);
     }
     return $navigation;
 }
开发者ID:Jazzee,项目名称:Jazzee,代码行数:50,代码来源:apply_welcome.php

示例4: getPageAnswerCounts

 /**
  * Get the answer counts for each page.
  * @param Application $application
  * @return array
  */
 public function getPageAnswerCounts(Application $application)
 {
     $query = $this->_em->createQuery('SELECT page.id as pageId, count(answer.id) as answers FROM Jazzee\\Entity\\Answer answer JOIN answer.page page JOIN answer.applicant applicant WHERE answer.applicant IN (SELECT app1.id FROM Jazzee\\Entity\\Applicant app1 WHERE app1.application = :applicationId) GROUP BY answer.applicant, answer.page');
     $query->setParameter('applicationId', $application->getId());
     $pageAnswers = array();
     foreach ($query->getResult() as $arr) {
         if (!array_key_exists($arr['pageId'], $pageAnswers) or $pageAnswers[$arr['pageId']] < $arr['answers']) {
             $pageAnswers[$arr['pageId']] = $arr['answers'];
         }
     }
     $pages = array();
     foreach ($application->getApplicationPages() as $applicationPage) {
         if (array_key_exists($applicationPage->getPage()->getId(), $pageAnswers)) {
             $pages[$applicationPage->getPage()->getId()] = $pageAnswers[$applicationPage->getPage()->getId()];
         } else {
             $pages[$applicationPage->getPage()->getId()] = 0;
         }
     }
     return $pages;
 }
开发者ID:Jazzee,项目名称:Jazzee,代码行数:25,代码来源:ApplicationRepository.php

示例5: noticeNewComment

 public function noticeNewComment(Comment $comment, Application $app)
 {
     $pkg = null;
     if ($comment->getPackageId()) {
         $pkg = PackageDb::retrieveByPK($comment->getPackageId());
     }
     $page_url = mfwRequest::makeURL("/app/comment?id={$app->getId()}#comment-{$comment->getNumber()}");
     ob_start();
     include APP_ROOT . '/data/notice_comment_mail_template.php';
     $body = ob_get_clean();
     $addresses = $this->getColumnArray('owner_mail');
     if (empty($addresses)) {
         return;
     }
     $subject = "New Comment to {$app->getTitle()}";
     $sender = Config::get('mail_sender');
     $to = implode(', ', $addresses);
     $header = "From: {$sender}";
     mb_language('uni');
     mb_internal_encoding('UTF-8');
     return !mb_send_mail($to, $subject, $body, $header);
 }
开发者ID:kzfk,项目名称:emlauncher,代码行数:22,代码来源:ApplicationOwner.php

示例6: findPDFTemplateArrayByApplication

 /**
  * All the applicants in an application
  * @param Application $application
  * @param \Jazzee\Interfaces\Display $display
  * @param array $applicantIds
  * @return array
  */
 public function findPDFTemplateArrayByApplication(Application $application, \Jazzee\Interfaces\Display $display, array $applicantIds)
 {
     $results = array();
     foreach (array_chunk($applicantIds, 20) as $limitedIds) {
         $queryBuilder = $this->deepApplicantQuery($display);
         $queryBuilder->andWhere('applicant.application = :applicationId');
         $queryBuilder->andWhere('applicant.deactivated=false');
         $queryBuilder->setParameter('applicationId', $application->getId());
         $expression = $queryBuilder->expr()->orX();
         foreach ($limitedIds as $key => $value) {
             $paramKey = 'applicantId' . $key;
             $expression->add($queryBuilder->expr()->eq("applicant.id", ":{$paramKey}"));
             $queryBuilder->setParameter($paramKey, $value);
         }
         $queryBuilder->andWhere($expression);
         $query = $queryBuilder->getQuery();
         $query->setHint(\Doctrine\ORM\Query::HINT_INCLUDE_META_COLUMNS, true);
         $query->setHydrationMode('ApplicantPDFTemplateHydrator');
         $results = array_merge($results, $query->execute());
     }
     return $results;
 }
开发者ID:Jazzee,项目名称:Jazzee,代码行数:29,代码来源:ApplicantRepository.php

示例7: foreach

    foreach ($files as $file) {
        $file = trim($file);
        // for cache file, we move it to its proper location
        if (strpos($file, str_replace(WEBROOT . DS, "", CACHE_DIR)) === 0) {
            $oldname = WEBROOT . DS . $file;
            $newname = WEBROOT . DS . "files/application" . str_replace(CACHE_DIR, "", WEBROOT . DS . $file);
            rename($oldname, $newname);
            $file = str_replace(WEBROOT . DS, "", $newname);
        }
        $rtn[] = $file;
    }
    $object->setIeltsTranscripts(implode("\n", $rtn));
    $object->setCreatedAt(time());
    if ($error_flag == false) {
        if ($object->save()) {
            Message::register(new Message(Message::SUCCESS, i18n(array("en" => "Thanks for your application. We will come back to you as soon as possible.", "zh" => "记录保存成功"))));
            sendemailAdmin('Apply for course', '<p>A new application for course has just been submitted: <br /><a href="http://en.ct21.com.au/admin/application/edit/' . $object->getId() . '">http://en.ct21.com.au/admin/application/edit/' . $object->getId() . '</a></p>');
            HTML::forwardBackToReferer();
        } else {
            Message::register(new Message(Message::DANGER, i18n(array("en" => "Record failed to save", "zh" => "记录保存失败"))));
        }
    }
}
$html = new HTML();
$html->renderOut('core/backend/html_header', array('title' => i18n(array('en' => 'Create Application', 'zh' => 'Create 申请'))));
$html->output('<div id="wrapper">');
$html->renderOut('core/backend/header');
$html->renderOut('application/backend/application_create', array('object' => $object));
$html->output('</div>');
$html->renderOut('core/backend/html_footer');
exit;
开发者ID:jeffreycai,项目名称:ct21,代码行数:31,代码来源:application_create.php

示例8:

	}

	//Delete application
	if (isset($_GET['delete']) && intval($_GET['delete']) > 0) {
		$app->deleteApplication();
		$msg->addFeedback('GADGET_REMOVED_SUCCESSFULLY');
		header('Location: '. $_SERVER['HTTP_REFERER']);
		exit;
	}

	//Display application settings
	if (isset($_GET['settings'])){
		include(AT_INCLUDE_PATH.'header.inc.php');
		$savant->assign('settings', $app->getSettings());	//userPrefs
		$savant->assign('user_settings', $app->getApplicationSettings($_SESSION['member_id']));
		$savant->assign('app_id', $app->getId());	//id
		$savant->display('social/application_settings.tmpl.php');
		include(AT_INCLUDE_PATH.'footer.inc.php');		
		exit;
	}

	//Save settings
	if (isset($_POST['app_settings'])){
		foreach ($app->getSettings() as $key=>$value){
			if(isset($_POST[$key])){
				//save values iff it is in the userPrefs serialized string.
				//don't save values blindly from the $_POST.
				$value = $addslashes($_POST[$key]);
				$app->setApplicationSettings($_SESSION['member_id'], $key, $value);
			}
		}
开发者ID:radiocontrolled,项目名称:ATutor,代码行数:31,代码来源:applications.php

示例9: findByApplication

 /**
  * Find all the threads for an application
  *
  * @param Application $application
  * @return Array $threads
  */
 public function findByApplication(Application $application)
 {
     $query = $this->_em->createQuery('SELECT t FROM Jazzee\\Entity\\Thread t WHERE t.applicant IN (SELECT a.id from \\Jazzee\\Entity\\Applicant a WHERE a.application = :applicationId) order by t.createdAt DESC');
     $query->setParameter('applicationId', $application->getId());
     return $query->getResult();
 }
开发者ID:Jazzee,项目名称:Jazzee,代码行数:12,代码来源:ThreadRepository.php

示例10: addInstanceToPool

 /**
  * Adds an object to the instance pool.
  *
  * Propel keeps cached copies of objects in an instance pool when they are retrieved
  * from the database.  In some cases -- especially when you override doSelect*()
  * methods in your stub classes -- you may need to explicitly add objects
  * to the cache in order to ensure that the same objects are always returned by doSelect*()
  * and retrieveByPK*() calls.
  *
  * @param      Application $value A Application object.
  * @param      string $key (optional) key to use for instance map (for performance boost if key was already calculated externally).
  */
 public static function addInstanceToPool(Application $obj, $key = null)
 {
     if (Propel::isInstancePoolingEnabled()) {
         if ($key === null) {
             $key = (string) $obj->getId();
         }
         // if key === null
         self::$instances[$key] = $obj;
     }
 }
开发者ID:yasirgit,项目名称:afids,代码行数:22,代码来源:BaseApplicationPeer.php

示例11: getInstallUsers

 public static function getInstallUsers(Application $app)
 {
     $sql = 'SELECT * FROM app_install_user WHERE app_id = ?';
     $rows = mfwDBIBase::getAll($sql, array($app->getId()));
     return new InstallUserSet($app, $rows);
 }
开发者ID:kzfk,项目名称:emlauncher,代码行数:6,代码来源:InstallLog.php

示例12: post

 public static function post(User $user, Application $app, $package_id, $message)
 {
     $sql = 'SELECT number FROM comment WHERE app_id=?ORDER BY id DESC LIMIT 1';
     $max_num = (int) mfwDBIBase::getOne($sql, array($app->getId()));
     $row = array('app_id' => $app->getId(), 'package_id' => $package_id ?: null, 'number' => $max_num + 1, 'mail' => $user->getMail(), 'message' => $message, 'created' => date('Y-m-d H:i:s'));
     $comment = new Comment($row);
     $comment->insert();
     return $comment;
 }
开发者ID:kzfk,项目名称:emlauncher,代码行数:9,代码来源:Comment.php

示例13: getDisplayForApplication

 /**
  * Get the display for a role
  * @param Application $application
  * @return Display
  */
 public function getDisplayForApplication(Application $application)
 {
     foreach ($this->displays as $display) {
         if ($display->getApplication()->getId() == $application->getId()) {
             return $display;
         }
     }
     return false;
 }
开发者ID:Jazzee,项目名称:Jazzee,代码行数:14,代码来源:Role.php

示例14: insertNewApp

 public static function insertNewApp($owner, $title, $image, $description, $repository)
 {
     $now = date('Y-m-d H:i:s');
     // insert new application
     $row = array('title' => $title, 'api_key' => static::makeApiKey(), 'description' => $description, 'repository' => $repository, 'date_to_sort' => $now, 'created' => $now);
     $app = new Application($row);
     $app->insert();
     // upload icon to S3
     $icon_key = static::uploadIcon($image, $app->getId());
     $table = static::TABLE_NAME;
     mfwDBIBase::query("UPDATE {$table} SET icon_key = :icon_key WHERE id= :id", array(':id' => $app->getId(), ':icon_key' => $icon_key));
     // insert owner
     $row = array('app_id' => $app->getId(), 'owner_mail' => $owner->getMail());
     $owner = new ApplicationOwner($row);
     $owner->insert();
     return $app;
 }
开发者ID:kzfk,项目名称:emlauncher,代码行数:17,代码来源:Application.php

示例15: findOneByApplicationAndMember

 /**
  * find one by application and member
  *
  * @param Application $application
  * @param Member      $member
  * @return MemberApplication
  */
 public function findOneByApplicationAndMember($application, $member)
 {
     return $this->createQuery()->where('application_id = ?', $application->getId())->andWhere('member_id =?', $member->getId())->fetchOne();
 }
开发者ID:niryuu,项目名称:opOpenSocialPlugin,代码行数:11,代码来源:PluginMemberApplicationTable.class.php


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