original_string: public function discoverFields() {
      if (!empty($this->fields)) {
        return; // Already configured.
      }
  
      $sm = $this->db()->getSchemaManager();
      $columns = $sm->listTableColumns($this->table);
      foreach ($columns as $column) {
        $this->fields[$column->getName()] = array(
          'name' => $column->getName(),
          'type' => $column->getType(),
        );
      }
  
      try {
        $this->fks = $sm->listTableForeignKeys($this->table);
      } catch (\DBALException $e) {
        //Platform does not support foreign keys.
        $this->fks = array();
      }
    }
code: public function discoverFields() {
      if (!empty($this->fields)) {
        return; // Already configured.
      }
  
      $sm = $this->db()->getSchemaManager();
      $columns = $sm->listTableColumns($this->table);
      foreach ($columns as $column) {
        $this->fields[$column->getName()] = array(
          'name' => $column->getName(),
          'type' => $column->getType(),
        );
      }
  
      try {
        $this->fks = $sm->listTableForeignKeys($this->table);
      } catch (\DBALException $e) {
        //Platform does not support foreign keys.
        $this->fks = array();
      }
    }
code_tokens: public function discoverFields ( ) { if ( ! empty ( $ this -> fields ) ) { return ; // Already configured. } $ sm = $ this -> db ( ) -> getSchemaManager ( ) ; $ columns = $ sm -> listTableColumns ( $ this -> table ) ; foreach ( $ columns as $ column ) { $ this -> fields [ $ column -> getName ( ) ] = array ( 'name' => $ column -> getName ( ) , 'type' => $ column -> getType ( ) , ) ; } try { $ this -> fks = $ sm -> listTableForeignKeys ( $ this -> table ) ; } catch ( \ DBALException $ e ) { //Platform does not support foreign keys. $ this -> fks = array ( ) ; } }
docstring: Gets info of the fields from the table.
docstring_tokens: Gets info of the fields from the table .