人人商城

Plugin.php 775B

123456789101112131415161718192021222324252627282930
  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 deleteByMainModule($modulename) {
  19. if (empty($modulename)) {
  20. return true;
  21. }
  22. return $this->query->where('main_module', $modulename)->delete();
  23. }
  24. public function getPluginExists($main_module, $plugin_name) {
  25. return $this->query->where('main_module', $main_module)->where('name', $plugin_name)->exists();
  26. }
  27. }