original_string: protected function getPropertiesFromTable($model)
      {
          $table = $model->getConnection()->getTablePrefix() . $model->getTable();
          $schema = $model->getConnection()->getDoctrineSchemaManager($table);
          $databasePlatform = $schema->getDatabasePlatform();
          $databasePlatform->registerDoctrineTypeMapping('enum', 'string');
  
          $platformName = $databasePlatform->getName();
          $customTypes = $this->laravel['config']->get("ide-helper.custom_db_types.{$platformName}", array());
          foreach ($customTypes as $yourTypeName => $doctrineTypeName) {
              $databasePlatform->registerDoctrineTypeMapping($yourTypeName, $doctrineTypeName);
          }
  
          $database = null;
          if (strpos($table, '.')) {
              list($database, $table) = explode('.', $table);
          }
  
          $columns = $schema->listTableColumns($table, $database);
  
          if ($columns) {
              foreach ($columns as $column) {
                  $name = $column->getName();
                  if (in_array($name, $model->getDates())) {
                      $type = '\Illuminate\Support\Carbon';
                  } else {
                      $type = $column->getType()->getName();
                      switch ($type) {
                          case 'string':
                          case 'text':
                          case 'date':
                          case 'time':
                          case 'guid':
                          case 'datetimetz':
                          case 'datetime':
                              $type = 'string';
                              break;
                          case 'integer':
                          case 'bigint':
                          case 'smallint':
                              $type = 'integer';
                              break;
                          case 'boolean':
                              switch (config('database.default')) {
                                  case 'sqlite':
                                  case 'mysql':
                                      $type = 'integer';
                                      break;
                                  default:
                                      $type = 'boolean';
                                      break;
                              }
                              break;
                          case 'decimal':
                          case 'float':
                              $type = 'float';
                              break;
                          default:
                              $type = 'mixed';
                              break;
                      }
                  }
  
                  $comment = $column->getComment();
                  if (!$column->getNotnull()) {
                      $this->nullableColumns[$name] = true;
                  }
                  $this->setProperty($name, $type, true, true, $comment, !$column->getNotnull());
                  if ($this->write_model_magic_where) {
                      $this->setMethod(
                          Str::camel("where_" . $name),
                          '\Illuminate\Database\Eloquent\Builder|\\' . get_class($model),
                          array('$value')
                      );
                  }
              }
          }
      }
code: protected function getPropertiesFromTable($model)
      {
          $table = $model->getConnection()->getTablePrefix() . $model->getTable();
          $schema = $model->getConnection()->getDoctrineSchemaManager($table);
          $databasePlatform = $schema->getDatabasePlatform();
          $databasePlatform->registerDoctrineTypeMapping('enum', 'string');
  
          $platformName = $databasePlatform->getName();
          $customTypes = $this->laravel['config']->get("ide-helper.custom_db_types.{$platformName}", array());
          foreach ($customTypes as $yourTypeName => $doctrineTypeName) {
              $databasePlatform->registerDoctrineTypeMapping($yourTypeName, $doctrineTypeName);
          }
  
          $database = null;
          if (strpos($table, '.')) {
              list($database, $table) = explode('.', $table);
          }
  
          $columns = $schema->listTableColumns($table, $database);
  
          if ($columns) {
              foreach ($columns as $column) {
                  $name = $column->getName();
                  if (in_array($name, $model->getDates())) {
                      $type = '\Illuminate\Support\Carbon';
                  } else {
                      $type = $column->getType()->getName();
                      switch ($type) {
                          case 'string':
                          case 'text':
                          case 'date':
                          case 'time':
                          case 'guid':
                          case 'datetimetz':
                          case 'datetime':
                              $type = 'string';
                              break;
                          case 'integer':
                          case 'bigint':
                          case 'smallint':
                              $type = 'integer';
                              break;
                          case 'boolean':
                              switch (config('database.default')) {
                                  case 'sqlite':
                                  case 'mysql':
                                      $type = 'integer';
                                      break;
                                  default:
                                      $type = 'boolean';
                                      break;
                              }
                              break;
                          case 'decimal':
                          case 'float':
                              $type = 'float';
                              break;
                          default:
                              $type = 'mixed';
                              break;
                      }
                  }
  
                  $comment = $column->getComment();
                  if (!$column->getNotnull()) {
                      $this->nullableColumns[$name] = true;
                  }
                  $this->setProperty($name, $type, true, true, $comment, !$column->getNotnull());
                  if ($this->write_model_magic_where) {
                      $this->setMethod(
                          Str::camel("where_" . $name),
                          '\Illuminate\Database\Eloquent\Builder|\\' . get_class($model),
                          array('$value')
                      );
                  }
              }
          }
      }
code_tokens: protected function getPropertiesFromTable ( $ model ) { $ table = $ model -> getConnection ( ) -> getTablePrefix ( ) . $ model -> getTable ( ) ; $ schema = $ model -> getConnection ( ) -> getDoctrineSchemaManager ( $ table ) ; $ databasePlatform = $ schema -> getDatabasePlatform ( ) ; $ databasePlatform -> registerDoctrineTypeMapping ( 'enum' , 'string' ) ; $ platformName = $ databasePlatform -> getName ( ) ; $ customTypes = $ this -> laravel [ 'config' ] -> get ( "ide-helper.custom_db_types.{$platformName}" , array ( ) ) ; foreach ( $ customTypes as $ yourTypeName => $ doctrineTypeName ) { $ databasePlatform -> registerDoctrineTypeMapping ( $ yourTypeName , $ doctrineTypeName ) ; } $ database = null ; if ( strpos ( $ table , '.' ) ) { list ( $ database , $ table ) = explode ( '.' , $ table ) ; } $ columns = $ schema -> listTableColumns ( $ table , $ database ) ; if ( $ columns ) { foreach ( $ columns as $ column ) { $ name = $ column -> getName ( ) ; if ( in_array ( $ name , $ model -> getDates ( ) ) ) { $ type = '\Illuminate\Support\Carbon' ; } else { $ type = $ column -> getType ( ) -> getName ( ) ; switch ( $ type ) { case 'string' : case 'text' : case 'date' : case 'time' : case 'guid' : case 'datetimetz' : case 'datetime' : $ type = 'string' ; break ; case 'integer' : case 'bigint' : case 'smallint' : $ type = 'integer' ; break ; case 'boolean' : switch ( config ( 'database.default' ) ) { case 'sqlite' : case 'mysql' : $ type = 'integer' ; break ; default : $ type = 'boolean' ; break ; } break ; case 'decimal' : case 'float' : $ type = 'float' ; break ; default : $ type = 'mixed' ; break ; } } $ comment = $ column -> getComment ( ) ; if ( ! $ column -> getNotnull ( ) ) { $ this -> nullableColumns [ $ name ] = true ; } $ this -> setProperty ( $ name , $ type , true , true , $ comment , ! $ column -> getNotnull ( ) ) ; if ( $ this -> write_model_magic_where ) { $ this -> setMethod ( Str :: camel ( "where_" . $ name ) , '\Illuminate\Database\Eloquent\Builder|\\' . get_class ( $ model ) , array ( '$value' ) ) ; } } } }
docstring: Load the properties from the database table.
  
  @param \Illuminate\Database\Eloquent\Model $model
docstring_tokens: Load the properties from the database table .