mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-20 02:53:11 +00:00
Allowing Methods to be set in ModelHooks
This commit is contained in:
@@ -749,7 +749,7 @@ class ModelsCommand extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setMethod($name, $type = '', $arguments = [], $comment = '')
|
public function setMethod($name, $type = '', $arguments = [], $comment = '')
|
||||||
{
|
{
|
||||||
$methods = array_change_key_case($this->methods, CASE_LOWER);
|
$methods = array_change_key_case($this->methods, CASE_LOWER);
|
||||||
|
|
||||||
@@ -761,6 +761,16 @@ class ModelsCommand extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
public function unsetMethod($name) {
|
||||||
|
unset($this->methods[strtolower($name)]);
|
||||||
|
}
|
||||||
|
|
||||||
|
public function getMethodType(Model $model, string $classType) {
|
||||||
|
$modelName = $this->getClassNameInDestinationFile($model, get_class($model));
|
||||||
|
$builder = $this->getClassNameInDestinationFile($model, $classType);
|
||||||
|
return $builder . '|' . $modelName;
|
||||||
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @param string $class
|
* @param string $class
|
||||||
* @return string
|
* @return string
|
||||||
|
|||||||
Reference in New Issue
Block a user