diff --git a/src/Console/ModelsCommand.php b/src/Console/ModelsCommand.php index 8dcbb23..f9cc80c 100644 --- a/src/Console/ModelsCommand.php +++ b/src/Console/ModelsCommand.php @@ -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); @@ -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 * @return string