Skip to content

Instantly share code, notes, and snippets.

@johanhar
Created March 22, 2012 12:02
Show Gist options
  • Save johanhar/2157928 to your computer and use it in GitHub Desktop.
Save johanhar/2157928 to your computer and use it in GitHub Desktop.
lawl
public function __get($name, $value) {
if ($name == "tariff" && get_called_class() != get_class($this)) {
return (intval($this->$name) / 100);
} else if ($name == "durationType" && get_called_class() != get_class($this)) {
} else {
return $this->$name;
}
}
public function __set($name, $value) {
if ($name == "tariff" && get_called_class() != get_class($this)) {
$this->$name = (intval($value) * 100);
} else {
$this->$name = $value;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment