Model.php 1.1 KB

123456789101112131415161718192021222324252627282930313233343536
  1. <?php
  2. // +----------------------------------------------------------------------
  3. // | ThinkPHP [ WE CAN DO IT JUST THINK ]
  4. // +----------------------------------------------------------------------
  5. // | Copyright (c) 2016 http://thinkphp.cn All rights reserved.
  6. // +----------------------------------------------------------------------
  7. // | Licensed ( http://www.apache.org/licenses/LICENSE-2.0 )
  8. // +----------------------------------------------------------------------
  9. // | Author: 刘志淳 <chun@engineer.com>
  10. // +----------------------------------------------------------------------
  11. namespace think\console\command\make;
  12. use think\console\command\Make;
  13. class Model extends Make
  14. {
  15. protected $type = "Model";
  16. protected function configure()
  17. {
  18. parent::configure();
  19. $this->setName('make:model')
  20. ->setDescription('Create a new model class');
  21. }
  22. protected function getStub()
  23. {
  24. return __DIR__ . '/stubs/model.stub';
  25. }
  26. protected function getNamespace($appNamespace, $module)
  27. {
  28. return parent::getNamespace($appNamespace, $module) . '\model';
  29. }
  30. }