original_string: public function addRow(Row $row)
      {
          // if there is a upper limit on the number of allowed rows and the table is full,
          // add the new row to the summary row
          if ($this->maximumAllowedRows > 0
              && $this->getRowsCount() >= $this->maximumAllowedRows - 1
          ) {
              if ($this->summaryRow === null) {
                  // create the summary row if necessary
  
                  $columns = array('label' => self::LABEL_SUMMARY_ROW) + $row->getColumns();
                  $this->addSummaryRow(new Row(array(Row::COLUMNS => $columns)));
              } else {
                  $this->summaryRow->sumRow(
                      $row, $enableCopyMetadata = false, $this->getMetadata(self::COLUMN_AGGREGATION_OPS_METADATA_NAME));
              }
              return $this->summaryRow;
          }
  
          $this->rows[] = $row;
          if (!$this->indexNotUpToDate
              && $this->rebuildIndexContinuously
          ) {
              $label = $row->getColumn('label');
              if ($label !== false) {
                  $this->rowsIndexByLabel[$label] = count($this->rows) - 1;
              }
          }
          return $row;
      }
code: public function addRow(Row $row)
      {
          // if there is a upper limit on the number of allowed rows and the table is full,
          // add the new row to the summary row
          if ($this->maximumAllowedRows > 0
              && $this->getRowsCount() >= $this->maximumAllowedRows - 1
          ) {
              if ($this->summaryRow === null) {
                  // create the summary row if necessary
  
                  $columns = array('label' => self::LABEL_SUMMARY_ROW) + $row->getColumns();
                  $this->addSummaryRow(new Row(array(Row::COLUMNS => $columns)));
              } else {
                  $this->summaryRow->sumRow(
                      $row, $enableCopyMetadata = false, $this->getMetadata(self::COLUMN_AGGREGATION_OPS_METADATA_NAME));
              }
              return $this->summaryRow;
          }
  
          $this->rows[] = $row;
          if (!$this->indexNotUpToDate
              && $this->rebuildIndexContinuously
          ) {
              $label = $row->getColumn('label');
              if ($label !== false) {
                  $this->rowsIndexByLabel[$label] = count($this->rows) - 1;
              }
          }
          return $row;
      }
code_tokens: public function addRow ( Row $ row ) { // if there is a upper limit on the number of allowed rows and the table is full, // add the new row to the summary row if ( $ this -> maximumAllowedRows > 0 && $ this -> getRowsCount ( ) >= $ this -> maximumAllowedRows - 1 ) { if ( $ this -> summaryRow === null ) { // create the summary row if necessary $ columns = array ( 'label' => self :: LABEL_SUMMARY_ROW ) + $ row -> getColumns ( ) ; $ this -> addSummaryRow ( new Row ( array ( Row :: COLUMNS => $ columns ) ) ) ; } else { $ this -> summaryRow -> sumRow ( $ row , $ enableCopyMetadata = false , $ this -> getMetadata ( self :: COLUMN_AGGREGATION_OPS_METADATA_NAME ) ) ; } return $ this -> summaryRow ; } $ this -> rows [ ] = $ row ; if ( ! $ this -> indexNotUpToDate && $ this -> rebuildIndexContinuously ) { $ label = $ row -> getColumn ( 'label' ) ; if ( $ label !== false ) { $ this -> rowsIndexByLabel [ $ label ] = count ( $ this -> rows ) - 1 ; } } return $ row ; }
docstring: Adds a row to this table.
  
  If {@link setMaximumAllowedRows()} was called and the current row count is
  at the maximum, the new row will be summed to the summary row. If there is no summary row,
  this row is set as the summary row.
  
  @param Row $row
  @return Row `$row` or the summary row if we're at the maximum number of rows.
docstring_tokens: Adds a row to this table .