summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
Diffstat (limited to 'shared/classes/1conf_build_common.php')
-rw-r--r--shared/classes/1conf_build_common.php9
1 files changed, 9 insertions, 0 deletions
diff --git a/shared/classes/1conf_build_common.php b/shared/classes/1conf_build_common.php
index aae1e42..35ba6e6 100644
--- a/shared/classes/1conf_build_common.php
+++ b/shared/classes/1conf_build_common.php
@@ -41,6 +41,15 @@ abstract class conf_build_common extends sql_row_obj {
}
return $opts;
}
+ // Returns the value (or object if $get_obj is true) of the option given by $name, or null if unset
+ public function get_opt($name, $get_obj=false) {
+ $opts=$this->get_opts($get_obj);
+ return isset($opts[$name])?$opts[$name]:null;
+ }
+ // Returns true if the given option is set and equals the given value, false otherwise
+ public function opt_is($name, $val) {
+ return (($r=$this->get_opt($name)) !== null && $r == $val);
+ }
// Generates a unique id and sets status to 1, writes self to db and returns id
public function init() {
global $S;