@param array|Traversable $row

@return string
165871
public function format($row)
    {
        $data = $this->getArray($row);
        $data = $this->process($data);

        return json_encode($data, $this->encodeOptions);
    }
672947
public function col_scale($row) {
        global $DB;

        if (empty($this->scale)) {
            $dbparams = array('id' => -($this->assignment->get_instance()->grade));
            $this->scale = $DB->get_record('scale', $dbparams);
        }

        if (!empty($this->scale->scale)) {
            return implode("\n", explode(',', $this->scale->scale));
        }
        return '';
    }
986574
protected function parseRow($row)
    {
        list($k, $v) = explode(':', $row, 2);

        if (preg_match('/^db\d+$/', $k)) {
            $v = $this->parseDatabaseStats($v);
        }

        return array($k, $v);
    }
767004
protected function getHtmlBody(array $rows): string
  {
    $ret = '';
    $i   = 0;
    foreach ($rows as $row)
    {
      $class = static::$class;
      if ($class!==null) $class .= ' ';
      $class .= ($i % 2==0) ? 'even' : 'odd';

      $ret .= Html::generateTag('tr', ['class' => $class]);
      foreach ($this->columns as $column)
      {
        $ret .= $column->getHtmlCell($row);
      }
      $ret .= '</tr>';
      $i++;
    }

    return $ret;
  }
225769
public function renderDataCell($row)
	{
		if ($this->grid->json) {
			$data = $this->grid->dataProvider->data[$row];
			$col = array();
			ob_start();
			$this->renderDataCellContent($row, $data);
			$col['content'] = ob_get_contents();
			ob_end_clean();
			$col['attrs'] = '';
			return $col;

		}

		parent::renderDataCell($row);
	}
741545
public function marshal($row)
    {
        foreach ($this->_props as $key=>$prop) {
            if (isset($row[$key])) {
                $row[$key] = $prop->type->marshal($row[$key]);
            }
        }

        return $row;
    }
35539
protected function cleanupRow($row)
    {
        foreach ($row as $key => $column) {
            if ($this->isQuoted($column)) {
                $column = $this->unescape($this->unquote($column));
            }
            if ($this->isSerialized($column)) {
                $column = $this->unserialize($column);
            }
            if ('N;' === $column) {
                $column = null;
            }
            $row[$key] = $column;
        }

        return $row;
    }
502135
public function getValue($row, Table $table)
    {
        if (!$this->value)
            return $row->{$this->name};
        if (is_string($this->value)) {
            $res = '';
            eval("\$res = {$this->value};");
            return $res;
        } elseif (is_callable($this->value)) {
            return call_user_func($this->value, $row, $table);
        }
    }
1088316
public function format_row($row) {
        if ($this->rownum < 0) {
            $this->rownum = $this->currpage * $this->pagesize;
        } else {
            $this->rownum += 1;
        }

        return parent::format_row($row);
    }
455975
public function getCellValue(int $col, int $row): string
    {
        if (!isset($this->structure[$row][$col])) {
            return '';
        }

        return $this->structure[$row][$col]['value'];
    }
129515
public function toHtml(array $row)
    {
        if ($this->getLabel() == '') {
            throw new \InvalidArgumentException(
                'A label is required for this action type, please call $action->setLabel()!'
            );
        }

        $label = $this->getLabel();
        if ($label instanceof AbstractColumn) {
            $label = $row[$label->getUniqueId()];
        }

        return '<a '.$this->getAttributesString($row).'>'.$label.'</a>';
    }
479479
public function process(array $row)
    {
        foreach ($row as &$item) {
            if (is_object($item)) {
                if (method_exists($item, '__toString')) {
                    $item = $item->__toString();
                } else {
                    throw new InvalidArgumentException("Supplied object does not implement __toString");
                }
            }
        }

        return $row;
    }
1295894
protected static function filterBySubkey($row)
    {
        $result = false;
        if (is_array($row) && array_key_exists(self::$key, $row)) {
            if ('/' == substr(self::$value, 0, 1)) {
                $result = preg_match(self::$value, $row[self::$key]);
            } else {
                $result = self::$strict
                    ? self::$value === $row[self::$key]
                    : self::$value == $row[self::$key];
            }
        }

        return $result;
    }
1020795
public function getCellPrototype($row = NULL)
    {
        $td = parent::getCellPrototype($row);

        if ($this->isEditable() && $row !== NULL) {
            if (!in_array('editable', $td->class)) {
                $td->class[] = 'editable';
            }

            $value = $this->editableValueCallback === NULL
                ? $this->getValue($row)
                : call_user_func_array($this->editableValueCallback, [$row, $this]);

            $td->setAttribute('data-grido-editable-value', $value);
        }

        return $td;
    }
152590
public function getColumnValue(Row $row)
	{
		$value = parent::getColumnValue($row);

		if (!is_numeric($value)) {
			return $value;
		}

		return number_format(
			(float) $value,
			(int) $this->number_format[0],
			(string) $this->number_format[1],
			(string) $this->number_format[2]
		);
	}
1141535
public function content($row = null)
    {
        if (null === $row) {
            // Generate content for table head column

            $result = $this->label();
            if ($this->sortable()) {
                // Column is sortable - get anchor HTML
                $result .= $this->_getSortAnchor();
            }
            return $result;
        }

        if (!$this->hasRenderer()) {
            return (string)$row->{$this->index()};
        }

        return (string)$this->renderer($row);
    }
872316
public static function convertToArray($row)
    {
        $data = $row instanceof Arrayable ? $row->toArray() : (array) $row;

        foreach ($data as &$value) {
            if (is_object($value) || is_array($value)) {
                $value = self::convertToArray($value);
            }

            unset($value);
        }

        return $data;
    }