Undo casting time types to Time object #189
This commit is contained in:
@@ -114,26 +114,26 @@ class Flight extends BaseModel
|
|||||||
/**
|
/**
|
||||||
* @return Time
|
* @return Time
|
||||||
*/
|
*/
|
||||||
public function getFlightTimeAttribute()
|
/*public function getFlightTimeAttribute()
|
||||||
{
|
{
|
||||||
if (!array_key_exists('flight_time', $this->attributes)) {
|
if (!array_key_exists('flight_time', $this->attributes)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Time($this->attributes['flight_time']);
|
return new Time($this->attributes['flight_time']);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
public function setFlightTimeAttribute($value)
|
/*public function setFlightTimeAttribute($value)
|
||||||
{
|
{
|
||||||
if ($value instanceof Time) {
|
if ($value instanceof Time) {
|
||||||
$this->attributes['flight_time'] = $value->getMinutes();
|
$this->attributes['flight_time'] = $value->getMinutes();
|
||||||
} else {
|
} else {
|
||||||
$this->attributes['flight_time'] = $value;
|
$this->attributes['flight_time'] = $value;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Relationship
|
* Relationship
|
||||||
|
|||||||
@@ -141,26 +141,26 @@ class Pirep extends BaseModel
|
|||||||
/**
|
/**
|
||||||
* @return Time
|
* @return Time
|
||||||
*/
|
*/
|
||||||
public function getFlightTimeAttribute()
|
/*public function getFlightTimeAttribute()
|
||||||
{
|
{
|
||||||
if (!array_key_exists('flight_time', $this->attributes)) {
|
if (!array_key_exists('flight_time', $this->attributes)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Time($this->attributes['flight_time']);
|
return new Time($this->attributes['flight_time']);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
public function setFlightTimeAttribute($value)
|
/*public function setFlightTimeAttribute($value)
|
||||||
{
|
{
|
||||||
if($value instanceof Time) {
|
if($value instanceof Time) {
|
||||||
$this->attributes['flight_time'] = $value->getMinutes();
|
$this->attributes['flight_time'] = $value->getMinutes();
|
||||||
} else {
|
} else {
|
||||||
$this->attributes['flight_time'] = $value;
|
$this->attributes['flight_time'] = $value;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Return the planned_distance in a converter class
|
* Return the planned_distance in a converter class
|
||||||
@@ -200,26 +200,26 @@ class Pirep extends BaseModel
|
|||||||
/**
|
/**
|
||||||
* @return Time
|
* @return Time
|
||||||
*/
|
*/
|
||||||
public function getPlannedFlightTimeAttribute()
|
/*public function getPlannedFlightTimeAttribute()
|
||||||
{
|
{
|
||||||
if (!array_key_exists('planned_flight_time', $this->attributes)) {
|
if (!array_key_exists('planned_flight_time', $this->attributes)) {
|
||||||
return null;
|
return null;
|
||||||
}
|
}
|
||||||
|
|
||||||
return new Time($this->attributes['planned_flight_time']);
|
return new Time($this->attributes['planned_flight_time']);
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param $value
|
* @param $value
|
||||||
*/
|
*/
|
||||||
public function setPlannedFlightTimeAttribute($value)
|
/*public function setPlannedFlightTimeAttribute($value)
|
||||||
{
|
{
|
||||||
if ($value instanceof Time) {
|
if ($value instanceof Time) {
|
||||||
$this->attributes['planned_flight_time'] = $value->getMinutes();
|
$this->attributes['planned_flight_time'] = $value->getMinutes();
|
||||||
} else {
|
} else {
|
||||||
$this->attributes['planned_flight_time'] = $value;
|
$this->attributes['planned_flight_time'] = $value;
|
||||||
}
|
}
|
||||||
}
|
}*/
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* Do some cleanup on the route
|
* Do some cleanup on the route
|
||||||
|
|||||||
Reference in New Issue
Block a user