mirror of
https://github.com/barryvdh/laravel-ide-helper.git
synced 2026-08-18 18:13:11 +00:00
Compare commits
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
dab594804b | ||
|
|
83d5fe048d | ||
|
|
77b1bc923e | ||
|
|
9090aeb766 | ||
|
|
a5c16b0751 |
@@ -1,4 +1,4 @@
|
|||||||
## Laravel IDE Helper & Generator
|
## Laravel IDE Helper Generator
|
||||||
|
|
||||||
### Complete phpDocs, directly from the source
|
### Complete phpDocs, directly from the source
|
||||||
|
|
||||||
|
|||||||
@@ -136,17 +136,23 @@ class ModelsCommand extends Command {
|
|||||||
return $models;
|
return $models;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* Load the properties from the database table.
|
||||||
|
*
|
||||||
|
* @param \Illuminate\Database\Eloquent\Model $model
|
||||||
|
*/
|
||||||
protected function getPropertiesFromTable($model){
|
protected function getPropertiesFromTable($model){
|
||||||
$table = $model->getTable();
|
$table = $model->getTable();
|
||||||
$schema = $model->getConnection()->getDoctrineSchemaManager($table);
|
$schema = $model->getConnection()->getDoctrineSchemaManager($table);
|
||||||
|
$schema->getDatabasePlatform()->registerDoctrineTypeMapping('enum', 'string');
|
||||||
|
|
||||||
$columns = $schema->listTableColumns($table);
|
$columns = $schema->listTableColumns($table);
|
||||||
|
|
||||||
$properties = array();
|
|
||||||
if($columns){
|
if($columns){
|
||||||
foreach ($columns as $column) {
|
foreach ($columns as $column) {
|
||||||
$name = $column->getName();
|
$name = $column->getName();
|
||||||
$type = $column->getType()->getName();
|
$type = $column->getType()->getName();
|
||||||
|
|
||||||
switch($type){
|
switch($type){
|
||||||
case 'string':
|
case 'string':
|
||||||
case 'text':
|
case 'text':
|
||||||
@@ -180,6 +186,9 @@ class ModelsCommand extends Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param \Illuminate\Database\Eloquent\Model $model
|
||||||
|
*/
|
||||||
protected function getPropertiesFromMethods($model){
|
protected function getPropertiesFromMethods($model){
|
||||||
$methods = get_class_methods($model);
|
$methods = get_class_methods($model);
|
||||||
if($methods){
|
if($methods){
|
||||||
@@ -242,6 +251,12 @@ class ModelsCommand extends Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $name
|
||||||
|
* @param string|null $type
|
||||||
|
* @param bool|null $read
|
||||||
|
* @param bool|null $write
|
||||||
|
*/
|
||||||
protected function setProperty($name, $type = null, $read = null, $write = null){
|
protected function setProperty($name, $type = null, $read = null, $write = null){
|
||||||
if(!isset($this->properties[$name])){
|
if(!isset($this->properties[$name])){
|
||||||
$this->properties[$name] = array();
|
$this->properties[$name] = array();
|
||||||
@@ -270,6 +285,10 @@ class ModelsCommand extends Command {
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/**
|
||||||
|
* @param string $class
|
||||||
|
* @return string
|
||||||
|
*/
|
||||||
protected function createPhpDocs($class){
|
protected function createPhpDocs($class){
|
||||||
|
|
||||||
if(strpos($class, '\\') !== false){
|
if(strpos($class, '\\') !== false){
|
||||||
|
|||||||
Reference in New Issue
Block a user