Created
July 18, 2013 01:22
-
-
Save oojacoboo/6025998 to your computer and use it in GitHub Desktop.
This file contains hidden or 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
| <?php | |
| namespace WidgetFactory\Modules; | |
| class MyModule extends MyORM | |
| { | |
| const SEND_EMAILS = "sendEmails"; | |
| const SHARE_BY_DEFAULT = "shareByDefault"; | |
| /** | |
| * Shared method to get the option value from the db | |
| * @param string $option | |
| * @return mixed | |
| */ | |
| public function getOption($option) { | |
| return $this->query("SELECT `value` FROM `module_option` WHERE `name` = ?", array($option)); | |
| } | |
| /** | |
| * Update the option value | |
| * @param string $option | |
| * @param mixed $value | |
| * @return mixed | |
| */ | |
| public function setOption($option, $value) { | |
| return $this->query("UPDATE `module_option` SET `value` = ? WHERE `name` = ?", array($value, $option)); | |
| } | |
| } |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment