Plugin.php 926 B

12345678910111213141516171819202122232425262728293031323334
  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 Plugin extends \We7Table {
  8. protected $tableName = 'modules_plugin';
  9. protected $primaryKey = 'id';
  10. protected $field = array(
  11. 'name',
  12. 'main_module',
  13. );
  14. protected $default = array(
  15. 'name' => '',
  16. 'main_module' => '',
  17. );
  18. public function getAllByNameOrMainModule($modulenams) {
  19. return $this->where('name', $modulenams)->whereor('main_module', $modulenams)->getall();
  20. }
  21. public function deleteByMainModule($modulename) {
  22. if (empty($modulename)) {
  23. return true;
  24. }
  25. return $this->query->where('main_module', $modulename)->delete();
  26. }
  27. public function getPluginExists($main_module, $plugin_name) {
  28. return $this->query->where('main_module', $main_module)->where('name', $plugin_name)->exists();
  29. }
  30. }