Plugin.php 884 B

12345678910111213141516171819202122232425262728293031
  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($module_name) {
  19. return $this->where('name', $module_name)->whereor('main_module', $module_name)->getall();
  20. }
  21. public function deleteByMainModule($module_name) {
  22. return $this->query->where('main_module', $module_name)->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. }