本文整理汇总了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());
}
示例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;
}
示例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;
}
示例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");
}