original_string: protected function getTableColumns()
      {
          if (!$this->model->getConnection()->isDoctrineAvailable()) {
              throw new \Exception(
                  'You need to require doctrine/dbal: ~2.3 in your own composer.json to get database columns. '
              );
          }
  
          $table = $this->model->getConnection()->getTablePrefix().$this->model->getTable();
          /** @var \Doctrine\DBAL\Schema\MySqlSchemaManager $schema */
          $schema = $this->model->getConnection()->getDoctrineSchemaManager($table);
  
          // custom mapping the types that doctrine/dbal does not support
          $databasePlatform = $schema->getDatabasePlatform();
  
          foreach ($this->doctrineTypeMapping as $doctrineType => $dbTypes) {
              foreach ($dbTypes as $dbType) {
                  $databasePlatform->registerDoctrineTypeMapping($dbType, $doctrineType);
              }
          }
  
          $database = null;
          if (strpos($table, '.')) {
              list($database, $table) = explode('.', $table);
          }
  
          return $schema->listTableColumns($table, $database);
      }
code: protected function getTableColumns()
      {
          if (!$this->model->getConnection()->isDoctrineAvailable()) {
              throw new \Exception(
                  'You need to require doctrine/dbal: ~2.3 in your own composer.json to get database columns. '
              );
          }
  
          $table = $this->model->getConnection()->getTablePrefix().$this->model->getTable();
          /** @var \Doctrine\DBAL\Schema\MySqlSchemaManager $schema */
          $schema = $this->model->getConnection()->getDoctrineSchemaManager($table);
  
          // custom mapping the types that doctrine/dbal does not support
          $databasePlatform = $schema->getDatabasePlatform();
  
          foreach ($this->doctrineTypeMapping as $doctrineType => $dbTypes) {
              foreach ($dbTypes as $dbType) {
                  $databasePlatform->registerDoctrineTypeMapping($dbType, $doctrineType);
              }
          }
  
          $database = null;
          if (strpos($table, '.')) {
              list($database, $table) = explode('.', $table);
          }
  
          return $schema->listTableColumns($table, $database);
      }
code_tokens: protected function getTableColumns ( ) { if ( ! $ this -> model -> getConnection ( ) -> isDoctrineAvailable ( ) ) { throw new \ Exception ( 'You need to require doctrine/dbal: ~2.3 in your own composer.json to get database columns. ' ) ; } $ table = $ this -> model -> getConnection ( ) -> getTablePrefix ( ) . $ this -> model -> getTable ( ) ; /** @var \Doctrine\DBAL\Schema\MySqlSchemaManager $schema */ $ schema = $ this -> model -> getConnection ( ) -> getDoctrineSchemaManager ( $ table ) ; // custom mapping the types that doctrine/dbal does not support $ databasePlatform = $ schema -> getDatabasePlatform ( ) ; foreach ( $ this -> doctrineTypeMapping as $ doctrineType => $ dbTypes ) { foreach ( $ dbTypes as $ dbType ) { $ databasePlatform -> registerDoctrineTypeMapping ( $ dbType , $ doctrineType ) ; } } $ database = null ; if ( strpos ( $ table , '.' ) ) { list ( $ database , $ table ) = explode ( '.' , $ table ) ; } return $ schema -> listTableColumns ( $ table , $ database ) ; }
docstring: Get columns of a giving model.
  
  @throws \Exception
  
  @return \Doctrine\DBAL\Schema\Column[]
docstring_tokens: Get columns of a giving model .