You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

21 rivejä
549 B

3 vuotta sitten
  1. <?php
  2. namespace Api\Model;
  3. use Api\Model\BaseModel;
  4. class OptionsModel extends BaseModel {
  5. //
  6. public function get($option_name){
  7. $res = $this->where(" option_name = '%s' " ,array($option_name))->find();
  8. if ($res) {
  9. return $res['option_value'] ;
  10. }
  11. return false;
  12. }
  13. //
  14. public function set($option_name,$option_value){
  15. $sql = " replace into options (option_name , option_value ) values ('$option_name' , '$option_value')";
  16. return $this->execute($sql);;
  17. }
  18. }