Changeset View
Changeset View
Standalone View
Standalone View
src/aphront/httpparametertype/AphrontEpochHTTPParameterType.php
<?php | <?php | ||||
final class AphrontEpochHTTPParameterType | final class AphrontEpochHTTPParameterType | ||||
extends AphrontHTTPParameterType { | extends AphrontHTTPParameterType { | ||||
private $allowNull; | |||||
public function setAllowNull($allow_null) { | |||||
$this->allowNull = $allow_null; | |||||
return $this; | |||||
} | |||||
public function getAllowNull() { | |||||
return $this->allowNull; | |||||
} | |||||
protected function getParameterExists(AphrontRequest $request, $key) { | protected function getParameterExists(AphrontRequest $request, $key) { | ||||
return $request->getExists($key) || | return $request->getExists($key) || | ||||
$request->getExists($key.'_d'); | $request->getExists($key.'_d'); | ||||
} | } | ||||
protected function getParameterValue(AphrontRequest $request, $key) { | protected function getParameterValue(AphrontRequest $request, $key) { | ||||
return AphrontFormDateControlValue::newFromRequest($request, $key); | $value = AphrontFormDateControlValue::newFromRequest($request, $key); | ||||
if ($this->getAllowNull()) { | |||||
$value->setOptional(true); | |||||
} | |||||
return $value; | |||||
} | } | ||||
protected function getParameterTypeName() { | protected function getParameterTypeName() { | ||||
return 'epoch'; | return 'epoch'; | ||||
} | } | ||||
protected function getParameterFormatDescriptions() { | protected function getParameterFormatDescriptions() { | ||||
return array( | return array( | ||||
Show All 17 Lines |