本文整理汇总了PHP中DateTimeHelper::formatForJs方法的典型用法代码示例。如果您正苦于以下问题:PHP DateTimeHelper::formatForJs方法的具体用法?PHP DateTimeHelper::formatForJs怎么用?PHP DateTimeHelper::formatForJs使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DateTimeHelper
的用法示例。
在下文中一共展示了DateTimeHelper::formatForJs方法的4个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getJsonObject
public function getJsonObject()
{
$ret = array('departureCity' => $this->getDepartureCity()->localRu, 'departureCityPre' => $this->getDepartureCity()->casePre, 'arrivalCity' => $this->getArrivalCity()->localRu, 'arrivalCityPre' => $this->getArrivalCity()->casePre, 'departureDate' => DateTimeHelper::formatForJs($this->departureDate), 'arrivalDate' => DateTimeHelper::formatForJs($this->getArrivalDate()), 'fullDuration' => $this->fullDuration, 'flightParts' => array());
foreach ($this->flightParts as $flightPart) {
$ret['flightParts'][] = $flightPart->getJsonObject();
}
return $ret;
}
示例2: getJsonObject
public function getJsonObject()
{
$airline = Airline::getAirlineByCode($this->transportAirlineCode);
//echo 1;
//die();
if (!$this->markAirline) {
//$this->markAirline = $airline;
$ret = array('transportAirline' => $this->transportAirlineCode, 'transportAirlineName' => $airline->localRu, 'transportAirlineNameEn' => $airline->localEn, 'departureCity' => City::getCityByPk($this->departureCityId)->localRu, 'departureCityPre' => City::getCityByPk($this->departureCityId)->casePre, 'departureCityId' => $this->departureCityId, 'arrivalCity' => City::getCityByPk($this->arrivalCityId)->localRu, 'arrivalCityPre' => City::getCityByPk($this->arrivalCityId)->casePre, 'arrivalCityId' => $this->arrivalCityId, 'datetimeBegin' => DateTimeHelper::formatForJs($this->timestampBegin), 'datetimeEnd' => DateTimeHelper::formatForJs($this->timestampEnd), 'flightCode' => $this->code, 'duration' => $this->duration, 'departureAirport' => $this->departureAirport->localRu, 'arrivalAirport' => $this->arrivalAirport->localRu, 'departureAirportId' => $this->departureAirport->id, 'arrivalAirportId' => $this->arrivalAirport->id, 'aircraftCode' => $this->aircraftCode, 'aircraftName' => $this->getAircraftName(), 'stopNum' => $this->stopNum, 'bookingCode' => $this->bookingCodes[0]);
} else {
$ret = array('transportAirline' => $this->transportAirlineCode, 'transportAirlineName' => $airline->localRu, 'transportAirlineNameEn' => $airline->localEn, 'markAirline' => $this->markAirline->code, 'markAirlineName' => $this->markAirline->localRu, 'markAirlineNameEn' => $this->markAirline->localEn, 'departureCity' => City::getCityByPk($this->departureCityId)->localRu, 'departureCityPre' => City::getCityByPk($this->departureCityId)->casePre, 'departureCityId' => $this->departureCityId, 'arrivalCity' => City::getCityByPk($this->arrivalCityId)->localRu, 'arrivalCityPre' => City::getCityByPk($this->arrivalCityId)->casePre, 'arrivalCityId' => $this->arrivalCityId, 'datetimeBegin' => DateTimeHelper::formatForJs($this->timestampBegin), 'datetimeEnd' => DateTimeHelper::formatForJs($this->timestampEnd), 'flightCode' => $this->code, 'duration' => $this->duration, 'departureAirport' => $this->departureAirport->localRu, 'arrivalAirport' => $this->arrivalAirport->localRu, 'departureAirportId' => $this->departureAirport->id, 'arrivalAirportId' => $this->arrivalAirport->id, 'aircraftCode' => $this->aircraftCode, 'aircraftName' => $this->getAircraftName(), 'stopNum' => $this->stopNum, 'bookingCode' => $this->bookingCodes[0]);
}
//print_r($ret);
//die();
return $ret;
}
示例3: getJsonObject
public function getJsonObject()
{
return array('departure' => $this->departureCity->localRu, 'departure_iata' => $this->departureCity->code, 'arrival' => $this->arrivalCity->localRu, 'arrival_iata' => $this->arrivalCity->code, 'date' => DateTimeHelper::formatForJs($this->departureDate));
}
示例4: getJsonObject
public function getJsonObject()
{
$data = array('id' => $this->id, 'active' => false, "startDate" => DateTimeHelper::formatForJs($this->startDate), "endDate" => DateTimeHelper::formatForJs($this->endDate), "address" => $this->address, "contact" => $this->contact, "thumb" => isset($this->pictureSmall) ? $this->imgSrc . $this->pictureSmall->url : $this->defaultThumbImageUrl, "preview" => $this->preview, "description" => $this->description, "image" => isset($this->pictureBig) ? $this->imgSrc . $this->pictureBig->url : $this->defaultBigImageUrl, "title" => $this->title, "categories" => $this->getCategoriesJsonObject(), "links" => $this->getLinksJsonObject(), "tags" => $this->getTagsJsonObject(), "prices" => $this->getPricesJsonObject(), "tours" => $this->getToursJsonObject());
return $data;
}