当前位置: 首页>>代码示例>>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;未经允许,请勿转载。