original_string: protected function loadSubtable($dataTable, $row)
      {
          if (!($this->apiModule && $this->apiMethod && count($this->request))) {
              return null;
          }
  
          $request = $this->request;
  
          $idSubTable = $row->getIdSubDataTable();
          if ($idSubTable === null) {
              return null;
          }
  
          $request['idSubtable'] = $idSubTable;
          if ($dataTable) {
              $period = $dataTable->getMetadata(DataTableFactory::TABLE_METADATA_PERIOD_INDEX);
              if ($period instanceof Range) {
                  $request['date'] = $period->getDateStart() . ',' . $period->getDateEnd();
              } else {
                  $request['date'] = $period->getDateStart()->toString();
              }
          }
  
          $method = $this->getApiMethodForSubtable($request);
          return $this->callApiAndReturnDataTable($this->apiModule, $method, $request);
      }
code: protected function loadSubtable($dataTable, $row)
      {
          if (!($this->apiModule && $this->apiMethod && count($this->request))) {
              return null;
          }
  
          $request = $this->request;
  
          $idSubTable = $row->getIdSubDataTable();
          if ($idSubTable === null) {
              return null;
          }
  
          $request['idSubtable'] = $idSubTable;
          if ($dataTable) {
              $period = $dataTable->getMetadata(DataTableFactory::TABLE_METADATA_PERIOD_INDEX);
              if ($period instanceof Range) {
                  $request['date'] = $period->getDateStart() . ',' . $period->getDateEnd();
              } else {
                  $request['date'] = $period->getDateStart()->toString();
              }
          }
  
          $method = $this->getApiMethodForSubtable($request);
          return $this->callApiAndReturnDataTable($this->apiModule, $method, $request);
      }
code_tokens: protected function loadSubtable ( $ dataTable , $ row ) { if ( ! ( $ this -> apiModule && $ this -> apiMethod && count ( $ this -> request ) ) ) { return null ; } $ request = $ this -> request ; $ idSubTable = $ row -> getIdSubDataTable ( ) ; if ( $ idSubTable === null ) { return null ; } $ request [ 'idSubtable' ] = $ idSubTable ; if ( $ dataTable ) { $ period = $ dataTable -> getMetadata ( DataTableFactory :: TABLE_METADATA_PERIOD_INDEX ) ; if ( $ period instanceof Range ) { $ request [ 'date' ] = $ period -> getDateStart ( ) . ',' . $ period -> getDateEnd ( ) ; } else { $ request [ 'date' ] = $ period -> getDateStart ( ) -> toString ( ) ; } } $ method = $ this -> getApiMethodForSubtable ( $ request ) ; return $ this -> callApiAndReturnDataTable ( $ this -> apiModule , $ method , $ request ) ; }
docstring: Load the subtable for a row.
  Returns null if none is found.
  
  @param DataTable $dataTable
  @param Row $row
  
  @return DataTable
docstring_tokens: Load the subtable for a row . Returns null if none is found .