original_string: protected function extractModelFields($namespace)
      {
          $payload = [];
          try {
              $reflector = new \ReflectionClass($namespace);
              // Checks if reflector is a subclass of propel ActiveRecords
              if (NULL !== $reflector && $reflector->isSubclassOf(self::MODEL_INTERFACE)) {
                  $tableMap = $namespace::TABLE_MAP;
                  $tableMap = $tableMap::getTableMap();
                  /** @var ColumnMap $field */
                  foreach ($tableMap->getColumns() as $field) {
                      list($type, $format) = DocumentorHelper::translateSwaggerFormats($field->getType());
                      $info = [
                          "required" => $field->isNotNull(),
                          'format' => $format,
                      ];
                      if(count($field->getValueSet())) {
                          $info['enum'] = array_values($field->getValueSet());
                      }
                      if(null !== $field->getDefaultValue()) {
                          $info['default'] = $field->getDefaultValue();
                      }
                      $payload[ApiHelper::getColumnMapName($field)] = $info;
                  }
              } elseif (null !== $reflector && $reflector->isSubclassOf(self::DTO_INTERFACE)) {
                  $payload = $this->extractDtoProperties($namespace);
              }
          } catch (\Exception $e) {
              Logger::log($e->getMessage(), LOG_ERR);
          }
  
          return $payload;
      }
code: protected function extractModelFields($namespace)
      {
          $payload = [];
          try {
              $reflector = new \ReflectionClass($namespace);
              // Checks if reflector is a subclass of propel ActiveRecords
              if (NULL !== $reflector && $reflector->isSubclassOf(self::MODEL_INTERFACE)) {
                  $tableMap = $namespace::TABLE_MAP;
                  $tableMap = $tableMap::getTableMap();
                  /** @var ColumnMap $field */
                  foreach ($tableMap->getColumns() as $field) {
                      list($type, $format) = DocumentorHelper::translateSwaggerFormats($field->getType());
                      $info = [
                          "required" => $field->isNotNull(),
                          'format' => $format,
                      ];
                      if(count($field->getValueSet())) {
                          $info['enum'] = array_values($field->getValueSet());
                      }
                      if(null !== $field->getDefaultValue()) {
                          $info['default'] = $field->getDefaultValue();
                      }
                      $payload[ApiHelper::getColumnMapName($field)] = $info;
                  }
              } elseif (null !== $reflector && $reflector->isSubclassOf(self::DTO_INTERFACE)) {
                  $payload = $this->extractDtoProperties($namespace);
              }
          } catch (\Exception $e) {
              Logger::log($e->getMessage(), LOG_ERR);
          }
  
          return $payload;
      }
code_tokens: protected function extractModelFields ( $ namespace ) { $ payload = [ ] ; try { $ reflector = new \ ReflectionClass ( $ namespace ) ; // Checks if reflector is a subclass of propel ActiveRecords if ( NULL !== $ reflector && $ reflector -> isSubclassOf ( self :: MODEL_INTERFACE ) ) { $ tableMap = $ namespace :: TABLE_MAP ; $ tableMap = $ tableMap :: getTableMap ( ) ; /** @var ColumnMap $field */ foreach ( $ tableMap -> getColumns ( ) as $ field ) { list ( $ type , $ format ) = DocumentorHelper :: translateSwaggerFormats ( $ field -> getType ( ) ) ; $ info = [ "required" => $ field -> isNotNull ( ) , 'format' => $ format , ] ; if ( count ( $ field -> getValueSet ( ) ) ) { $ info [ 'enum' ] = array_values ( $ field -> getValueSet ( ) ) ; } if ( null !== $ field -> getDefaultValue ( ) ) { $ info [ 'default' ] = $ field -> getDefaultValue ( ) ; } $ payload [ ApiHelper :: getColumnMapName ( $ field ) ] = $ info ; } } elseif ( null !== $ reflector && $ reflector -> isSubclassOf ( self :: DTO_INTERFACE ) ) { $ payload = $ this -> extractDtoProperties ( $ namespace ) ; } } catch ( \ Exception $ e ) { Logger :: log ( $ e -> getMessage ( ) , LOG_ERR ) ; } return $ payload ; }
docstring: Extract all fields from a ActiveResource model
  
  @param string $namespace
  
  @return mixed
docstring_tokens: Extract all fields from a ActiveResource model