mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-19 10:33:11 +00:00
Merge pull request #150 from qufo/patch-1
Update ModelsCommand.php , Add COMMENT info.
This commit is contained in:
@@ -256,8 +256,8 @@ class ModelsCommand extends Command
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
$comment = $column->getComment();
|
||||||
$this->setProperty($name, $type, true, true);
|
$this->setProperty($name, $type, true, true,$comment);
|
||||||
$this->setMethod(
|
$this->setMethod(
|
||||||
Str::camel("where_" . $name),
|
Str::camel("where_" . $name),
|
||||||
'\Illuminate\Database\Query\Builder|\\' . get_class($model),
|
'\Illuminate\Database\Query\Builder|\\' . get_class($model),
|
||||||
@@ -361,8 +361,9 @@ class ModelsCommand extends Command
|
|||||||
* @param string|null $type
|
* @param string|null $type
|
||||||
* @param bool|null $read
|
* @param bool|null $read
|
||||||
* @param bool|null $write
|
* @param bool|null $write
|
||||||
|
* @param string|null $comment
|
||||||
*/
|
*/
|
||||||
protected function setProperty($name, $type = null, $read = null, $write = null)
|
protected function setProperty($name, $type = null, $read = null, $write = null,$comment=null)
|
||||||
{
|
{
|
||||||
if (!isset($this->properties[$name])) {
|
if (!isset($this->properties[$name])) {
|
||||||
$this->properties[$name] = array();
|
$this->properties[$name] = array();
|
||||||
@@ -379,6 +380,9 @@ class ModelsCommand extends Command
|
|||||||
if ($write !== null) {
|
if ($write !== null) {
|
||||||
$this->properties[$name]['write'] = $write;
|
$this->properties[$name]['write'] = $write;
|
||||||
}
|
}
|
||||||
|
if ($comment !== null ) {
|
||||||
|
$this->properties[$name]['comment'] = $comment;
|
||||||
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
protected function setMethod($name, $type = '', $arguments = array())
|
protected function setMethod($name, $type = '', $arguments = array())
|
||||||
@@ -435,7 +439,8 @@ class ModelsCommand extends Command
|
|||||||
} else {
|
} else {
|
||||||
$attr = 'property-read';
|
$attr = 'property-read';
|
||||||
}
|
}
|
||||||
$tag = Tag::createInstance("@{$attr} {$property['type']} {$name}", $phpdoc);
|
$comment = isset($property['comment'])?$property['comment']:'';
|
||||||
|
$tag = Tag::createInstance("@{$attr} {$property['type']} {$name} {$comment}", $phpdoc);
|
||||||
$phpdoc->appendTag($tag);
|
$phpdoc->appendTag($tag);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user