人人商城

Bindings.php 1.4KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455
  1. <?php
  2. /**
  3. * [WeEngine System] Copyright (c) 2014 WE7.CC
  4. * WeEngine is NOT a free software, it under the license terms, visited http://www.we7.cc/ for more details.
  5. */
  6. namespace We7\Table\Modules;
  7. class Bindings extends \We7Table {
  8. protected $tableName = 'modules_bindings';
  9. protected $primaryKey = 'eid';
  10. protected $field = array(
  11. 'module',
  12. 'entry',
  13. 'call',
  14. 'title',
  15. 'do',
  16. 'state',
  17. 'direct',
  18. 'url',
  19. 'icon',
  20. 'displayorder',
  21. );
  22. protected $default = array(
  23. 'module' => '',
  24. 'entry' => '',
  25. 'call' => '',
  26. 'title' => '',
  27. 'do' => '',
  28. 'state' => '',
  29. 'direct' => 0,
  30. 'url' => '',
  31. 'icon' => 'wi wi-appsetting',
  32. 'displayorder' => 0,
  33. );
  34. public function deleteByName($modulename) {
  35. return $this->query->where('module', $modulename)->delete();
  36. }
  37. public function isEntryExists($modulename, $entry, $do) {
  38. return $this->query->where('module', $modulename)->where('entry', $entry)->where('do', $do)->exists();
  39. }
  40. public function isCallExists($modulename, $entry, $call) {
  41. return $this->query->where('module', $modulename)->where('entry', $entry)->where('call', $call)->exists();
  42. }
  43. public function getByEntryDo($modulename, $entry, $do) {
  44. return $this->query->where('module', $modulename)->where('entry', $entry)->where('do', $do)->get();
  45. }
  46. public function getByEntryCall($modulename, $entry, $call) {
  47. return $this->query->where('module', $modulename)->where('entry', $entry)->where('call', $call)->get();
  48. }
  49. }