public function __get($property) { switch ($property) { case 'button_data': case 'args': case 'handle': case 'button_slug': return $this->{$property}; default: throw new Exception('Invalid ' . __CLASS__ . ' property: ' . $property); } }