You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

2 jaren geleden
12345678910111213141516171819202122232425262728293031323334353637
  1. <?php
  2. namespace crmeb\command;
  3. use think\console\command\Make;
  4. /**
  5. * Class Business
  6. */
  7. class Dao extends Make
  8. {
  9. protected $type = "Dao";
  10. protected function configure()
  11. {
  12. parent::configure();
  13. $this->setName('make:dao')
  14. ->setDescription('Create a new service class');
  15. }
  16. protected function getStub(): string
  17. {
  18. return __DIR__ . DIRECTORY_SEPARATOR. 'stubs' . DIRECTORY_SEPARATOR . 'dao.stub';
  19. }
  20. protected function getNamespace(string $app): string
  21. {
  22. return parent::getNamespace($app) . '\\dao';
  23. }
  24. protected function getPathName(string $name): string
  25. {
  26. $name = str_replace('app\\', '', $name);
  27. return $this->app->getBasePath() . ltrim(str_replace('\\', '/', $name), '/') . 'Dao.php';
  28. }
  29. }