Add shorthands for timezone to tz

This commit is contained in:
Nabeel Shahzad 2018-02-06 11:02:40 -06:00
parent 1cc999a4f9
commit 56bf277fe0
2 changed files with 22 additions and 3 deletions

View File

@ -88,10 +88,20 @@ class Airport extends BaseModel
}
/**
* Shorthand for getting the timezone
* @return string
*/
public function getTzAttribute(): string
{
return $this->timezone;
}
/**
* Shorthand for setting the timezone
* @param $value
*/
public function setTzAttribute($value)
{
$this->attributes['timezone'] = $value;
}
}

View File

@ -93,14 +93,23 @@ class User extends Authenticatable
}
/**
* Return the timezone
* @return mixed
* Shorthand for getting the timezone
* @return string
*/
public function getTzAttribute()
public function getTzAttribute(): string
{
return $this->timezone;
}
/**
* Shorthand for setting the timezone
* @param $value
*/
public function setTzAttribute($value)
{
$this->attributes['timezone'] = $value;
}
/**
* @param mixed $size Size of the gravatar, in pixels
* @return string