mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 01:57:13 +00:00
feat(ModelsCommand): add configuration option to disable model query methods (#1692)
* feat(ModelsCommand): add configuration option to disable model query methods * composer fix-style * update comment * revert whitespace changes * composer fix-style * composer fix-style --------- Co-authored-by: laravel-ide-helper <[email protected]>
This commit is contained in:
co-authored by
laravel-ide-helper
parent
3bd70eafd0
commit
fd3cfbe09d
@@ -720,13 +720,16 @@ class ModelsCommand extends Command
|
||||
);
|
||||
$this->setMethod($name, $builder . '<static>|' . $modelName, $args, $comment);
|
||||
}
|
||||
} elseif (in_array($method, ['query', 'newQuery', 'newModelQuery'])) {
|
||||
$builder = $this->getClassNameInDestinationFile($model, get_class($model->newModelQuery()));
|
||||
} elseif (in_array($method, ['query', 'newQuery', 'newModelQuery'])
|
||||
) {
|
||||
if ($this->laravel['config']->get('ide-helper.write_query_methods', true)) {
|
||||
$builder = $this->getClassNameInDestinationFile($model, get_class($model->newModelQuery()));
|
||||
|
||||
$this->setMethod(
|
||||
$method,
|
||||
$builder . '<static>|' . $this->getClassNameInDestinationFile($model, get_class($model))
|
||||
);
|
||||
$this->setMethod(
|
||||
$method,
|
||||
$builder . '<static>|' . $this->getClassNameInDestinationFile($model, get_class($model))
|
||||
);
|
||||
}
|
||||
|
||||
if ($this->write_model_external_builder_methods) {
|
||||
$this->writeModelExternalBuilderMethods($model);
|
||||
|
||||
Reference in New Issue
Block a user