Created
March 24, 2014 16:56
-
-
Save pensiero/9744383 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
/** | |
* Magic getter to expose protected properties. | |
* | |
* @param string $property | |
* @return mixed | |
*/ | |
public function __get($property) { | |
return $this->{'get'.ucfirst($property)}(); | |
} | |
/** | |
* Magic setter to save protected properties. | |
* @param string $property | |
* @param mixed $value | |
*/ | |
public function __set($property, $value) { | |
$this->{'set'.ucfirst($property)}($value); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment