當前位置: 首頁>>代碼示例>>PHP>>正文


PHP DateTimeUtils::getCurrentDate方法代碼示例

本文整理匯總了PHP中DateTimeUtils::getCurrentDate方法的典型用法代碼示例。如果您正苦於以下問題:PHP DateTimeUtils::getCurrentDate方法的具體用法?PHP DateTimeUtils::getCurrentDate怎麽用?PHP DateTimeUtils::getCurrentDate使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在DateTimeUtils的用法示例。


在下文中一共展示了DateTimeUtils::getCurrentDate方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: testCreateTraining

 /**
  *
  */
 public function testCreateTraining()
 {
     $factory = new MarketplaceFactory();
     $training = $factory->buildTraining();
     $training->setName('test training');
     $training->setDescription('test training description');
     $training->activate();
     $service = new TrainingServiceManager($repository = new SapphireTrainingServiceRepository());
     $repository->add($training);
     $courses = $service->getCoursesByDate($training->getIdentifier(), DateTimeUtils::getCurrentDate());
 }
開發者ID:OpenStackweb,項目名稱:openstack-org,代碼行數:14,代碼來源:TrainingServiceTest.php

示例2: getCompanyTraining

 /**
  * @param int $training_id
  * @param string $company_url_segment
  * @return array
  * @throws Exception
  */
 public function getCompanyTraining($training_id, $company_url_segment)
 {
     if (empty($company_url_segment)) {
         throw new Exception("Invalid Company");
     }
     //@todo: remove dataobjects dependencies
     $company = Company::get()->filter('URLSegment', $company_url_segment)->first();
     $training = empty($training_id) ? null : TrainingService::get()->byID($training_id);
     if (!$company) {
         throw new Exception("Invalid Company");
     }
     if (!$training) {
         //get default program
         $training = $company->getDefaultTraining();
     }
     //check if program belongs to selected company
     $training_company = $training->Company();
     if ($training_company->getIdentifier() != $company->getIdentifier()) {
         //if not , get default program
         $training = $company->getDefaultTraining();
     }
     if (!$this->training_manager->isActive($training->getIdentifier())) {
         return Security::permissionFailure($this->controller, "non active training!.");
     }
     $courses = $this->training_manager->getCoursesByDate($training->getIdentifier(), DateTimeUtils::getCurrentDate());
     $courses_vm = new ArrayList();
     foreach ($courses as $course) {
         $course_dto = new CourseDTO($course->getIdentifier(), $course->getName(), $course->getDescription(), $course->getTraining()->getIdentifier(), null, null, null, $course->level()->Level, $course->isOnline(), null, null, null, null, null, $course->getOnlineLink());
         $locations_dto = $this->course_repository->getLocationsByDate($course->getIdentifier(), DateTimeUtils::getCurrentDate());
         $locations_vm = new ArrayList();
         foreach ($locations_dto as $location_dto) {
             $locations_vm->push(new CourseLocationViewModel($location_dto));
         }
         $courses_vm->push(new CourseViewModel($course_dto, $locations_vm, $course->projects()));
     }
     $res = array('Company' => $company, 'Training' => $training, 'Courses' => $courses_vm, 'Slug' => $training->getSlug());
     return $res;
 }
開發者ID:Thingee,項目名稱:openstack-org,代碼行數:44,代碼來源:TrainingFacade.php

示例3: CompanyCombo

 public function CompanyCombo()
 {
     $source = array();
     $result = $this->course_company_query->handle(new OpenStackImplementationNamesQuerySpecification(DateTimeUtils::getCurrentDate()));
     foreach ($result->getResult() as $dto) {
         $source[$dto->getValue()] = $dto->getValue();
     }
     $ddl = new DropdownField('company-term', $title = null, $source);
     $ddl->setEmptyString('-- Show All --');
     return $ddl;
 }
開發者ID:hogepodge,項目名稱:openstack-org,代碼行數:11,代碼來源:TrainingDirectoryPage.php

示例4: getCurrentAffiliations

 public function getCurrentAffiliations()
 {
     $current_date = DateTimeUtils::getCurrentDate();
     return $this->owner->Affiliations(" ( Current=1 OR EndDate > '{$current_date}') ", "Current DESC, StartDate DESC, EndDate DESC,LastEdited DESC");
 }
開發者ID:balajijegan,項目名稱:openstack-org,代碼行數:5,代碼來源:MemberDecorator.php


注:本文中的DateTimeUtils::getCurrentDate方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。