@param array $row

@return string
778220
public function encodeSegment(array $row): string
    {
        // init
        $str = '';
        $t = \count($row);

        foreach ($row as $i => &$iValue) {
            if (\is_array($iValue)) {
                if (\count($iValue) === 1
                    && \is_array(\reset($iValue))
                ) {
                    $iValue = \array_pop($iValue);
                }

                if (\is_array($iValue)) {
                    foreach ($iValue as &$temp) {
                        $temp = $this->escapeValue($temp);
                    }
                    unset($temp);
                }

                $elm = \implode($this->sepComp, $iValue);
            } else {
                $elm = $this->escapeValue($iValue);
            }

            $str .= $elm;
            if ($i == $t - 1) {
                break;
            }
            $str .= $this->sepData;
        }
        unset($iValue);

        $str .= $this->symbEnd;

        return $str;
    }
495070
public function getValue(array $row, array $rows = [])
    {
        if (isset($row[$this->getName()])) {
            $rawValue = $row[$this->getName()];
        } else {
            $rawValue = null;
        }
        // if a callback is set
        $callback = $this->getDisplayCallback();
        if (!is_null($callback)) {
            if (!is_callable($callback)) {
                throw new \Exception('displayCallback is not callable');
            }

            return $callback($rawValue, $row, $rows);
        } else {
            switch ($this->getDisplayFormat()) {
                case static::FORMAT_DATE:
                    $formatParams = $this->getDisplayFormatParams();
                    if (is_null($formatParams)) {
                        $formatParams = 'Y-m-d H:i:s';
                    }
                    if (!is_null($rawValue) && is_object($rawValue) && get_class($rawValue) == 'DateTime') {
                        return $rawValue->format($formatParams);
                    } else {
                        return '';
                    }
                    break;
                case static::FORMAT_TEXT:
                default:
                    if (is_array($rawValue)) {
                        return implode(',', $rawValue);
                    } else {
                        return $rawValue;
                    }
                    break;
            }
        }
    }
635684
private function _getWhere($row)
    {
        $where = array();
        foreach ($this->_groupBy as $k=>$field) {
            if (is_array($field)) {
                $values = $field;
                $field = $k;
                $valueFound = false;
                foreach ($values as $value) {
                    if ($row->$field == $value) {
                        $valueFound = true;
                        if (is_null($value)) {
                            $where[] = "ISNULL($field)";
                        } else {
                            $where["$field = ?"] = $value;
                        }
                        break;
                    }
                }
                if (!$valueFound) {
                    $in = array();
                    foreach ($values as $value) {
                        $in[] = $row->getTable()->getAdapter()->quote($value);
                    }
                    $in = implode(',', $in);
                    $where[] = "$field NOT IN ($in)";
                }
            } else {
                if (is_null($row->$field)) {
                    $where[] = "ISNULL($field)";
                } else {
                    $where["$field = ?"] = $row->$field;
                }
            }
        }
        return $where;
    }
679616
protected function extractFieldFromRow(array $row)
    {
        $field = new Field();

        $field->id = (int)$row['ezcontentobject_attribute_id'];
        $field->fieldDefinitionId = (int)$row['ezcontentobject_attribute_contentclassattribute_id'];
        $field->type = $row['ezcontentobject_attribute_data_type_string'];
        $field->value = $this->extractFieldValueFromRow($row, $field->type);
        $field->languageCode = $row['ezcontentobject_attribute_language_code'];
        $field->versionNo = isset($row['ezcontentobject_version_version']) ?
            (int)$row['ezcontentobject_version_version'] :
            (int)$row['ezcontentobject_attribute_version'];

        return $field;
    }
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);
        }
    }
801011
public function row( array $row ) {

		$extra_row_count = 0;

		if ( count( $row ) > 0 ) {
			$extra_rows = array_fill( 0, count( $row ), array() );

			foreach( $row as $col => $value ) {

				$value = str_replace( array( "\r\n", "\n" ), ' ', $value );

				$col_width = $this->_widths[ $col ];
				$encoding = function_exists( 'mb_detect_encoding' ) ? mb_detect_encoding( $value, null, true /*strict*/ ) : false;
				$original_val_width = Colors::width( $value, self::isPreColorized( $col ), $encoding );
				if ( $col_width && $original_val_width > $col_width ) {
					$row[ $col ] = \cli\safe_substr( $value, 0, $col_width, true /*is_width*/, $encoding );
					$value = \cli\safe_substr( $value, \cli\safe_strlen( $row[ $col ], $encoding ), null /*length*/, false /*is_width*/, $encoding );
					$i = 0;
					do {
						$extra_value = \cli\safe_substr( $value, 0, $col_width, true /*is_width*/, $encoding );
						$val_width = Colors::width( $extra_value, self::isPreColorized( $col ), $encoding );
						if ( $val_width ) {
							$extra_rows[ $col ][] = $extra_value;
							$value = \cli\safe_substr( $value, \cli\safe_strlen( $extra_value, $encoding ), null /*length*/, false /*is_width*/, $encoding );
							$i++;
							if ( $i > $extra_row_count ) {
								$extra_row_count = $i;
							}
						}
					} while( $value );
				}

			}
		}

		$row = array_map(array($this, 'padColumn'), $row, array_keys($row));
		array_unshift($row, ''); // First border
		array_push($row, ''); // Last border

		$ret = join($this->_characters['border'], $row);
		if ( $extra_row_count ) {
			foreach( $extra_rows as $col => $col_values ) {
				while( count( $col_values ) < $extra_row_count ) {
					$col_values[] = '';
				}
			}

			do {
				$row_values = array();
				$has_more = false;
				foreach( $extra_rows as $col => &$col_values ) {
					$row_values[ $col ] = array_shift( $col_values );
					if ( count( $col_values ) ) {
						$has_more = true;
					}
				}

				$row_values = array_map(array($this, 'padColumn'), $row_values, array_keys($row_values));
				array_unshift($row_values, ''); // First border
				array_push($row_values, ''); // Last border

				$ret .= PHP_EOL . join($this->_characters['border'], $row_values);
			} while( $has_more );
		}
		return $ret;
	}
835031
protected function _generateRow($row = null)
    {
        static $fp = false;

        if (empty($row)) {
            return '';
        }

        if ($fp === false) {
            $fp = fopen('php://temp', 'r+');

            if ($this->viewVars['_setSeparator']) {
                fwrite($fp, "sep=" . $this->viewVars['_delimiter'] . "\n");
            }
        } else {
            ftruncate($fp, 0);
        }

        if ($this->viewVars['_null'] !== '') {
            foreach ($row as &$field) {
                if ($field === null) {
                    $field = $this->viewVars['_null'];
                }
            }
        }

        $delimiter = $this->viewVars['_delimiter'];
        $enclosure = $this->viewVars['_enclosure'];
        $newline = $this->viewVars['_newline'];

        $row = str_replace(["\r\n", "\n", "\r"], $newline, $row);
        if ($enclosure === '') {
            // fputcsv does not supports empty enclosure
            if (fputs($fp, implode($delimiter, $row) . "\n") === false) {
                return false;
            }
        } else {
            if (fputcsv($fp, $row, $delimiter, $enclosure) === false) {
                return false;
            }
        }

        rewind($fp);

        $csv = '';
        while (($buffer = fgets($fp, 4096)) !== false) {
            $csv .= $buffer;
        }

        $eol = $this->viewVars['_eol'];
        if ($eol !== "\n") {
            $csv = str_replace("\n", $eol, $csv);
        }

        $dataEncoding = $this->viewVars['_dataEncoding'];
        $csvEncoding = $this->viewVars['_csvEncoding'];
        if ($dataEncoding !== $csvEncoding) {
            $extension = $this->viewVars['_extension'];
            if ($extension === self::EXTENSION_ICONV) {
                $csv = iconv($dataEncoding, $csvEncoding, $csv);
            } elseif ($extension === self::EXTENSION_MBSTRING) {
                $csv = mb_convert_encoding($csv, $csvEncoding, $dataEncoding);
            }
        }

        //bom must be added after encoding
        if ($this->viewVars['_bom'] && $this->isFirstBom) {
            $csv = $this->getBom($this->viewVars['_csvEncoding']) . $csv;
            $this->isFirstBom = false;
        }

        return $csv;
    }
397430
private function write(array $row)
    {
        if ($this->encodingFrom !== null && $this->encodingTo !== null) {
            foreach ($row as $k => $v) {
                $row[$k] = iconv($this->encodingFrom, $this->encodingTo, $v);
            }
        }

        return fputcsv($this->handle, $row, $this->delimiter, $this->enclosure, $this->escape);
    }
70063
public function process(array $row)
    {
        foreach ($row as &$item) {
            if ($item instanceof DateTimeInterface) {
                $item = $item->format($this->format);
            }
        }

        return $row;
    }
1050898
public function getDataCellContent($row)
	{
		$data=$this->grid->dataProvider->data[$row];
		if($this->urlExpression!==null)
			$url=$this->evaluateExpression($this->urlExpression,array('data'=>$data,'row'=>$row));
		else
			$url=$this->url;
		if($this->labelExpression!==null)
			$label=$this->evaluateExpression($this->labelExpression,array('data'=>$data,'row'=>$row));
		else
			$label=$this->label;
		$options=$this->linkHtmlOptions;
		if(is_string($this->imageUrl))
			return CHtml::link(CHtml::image($this->imageUrl,$label),$url,$options);
		else
			return CHtml::link($label,$url,$options);
	}
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);
    }
274685
public function getHighestColumn($row = null)
    {
        if ($row == null) {
            $colRow = $this->getHighestRowAndColumn();
            return $colRow['column'];
        }

        $columnList = array(1);
        foreach ($this->getCellList() as $coord) {
            sscanf($coord, '%[A-Z]%d', $c, $r);
            if ($r != $row) {
                continue;
            }
            $columnList[] = PHPExcel_Cell::columnIndexFromString($c);
        }
        return PHPExcel_Cell::stringFromColumnIndex(max($columnList) - 1);
    }
524792
public function getSubmitMessage($row)
    {
        $message = '';
        if ($this->getFormField()->getFieldLabel()) {
            $message .= $this->getFormField()->getFieldLabel().': ';
        }
        $t = strtotime($row->{$this->getFormField()->getName()});
        $message .= date($this->getData()->trlKwf('Y-m-d'), $t);
        return $message;
    }
329459
public function render(\Magento\Framework\DataObject $row)
    {
        $recipients = json_decode($row->getData($this->getColumn()->getIndex()), true);
        if(!empty($recipients))
        {
            $recipientsString = htmlspecialchars(implode(', ', $recipients));
            if(strlen($recipientsString) < 15)
            {
                return $recipientsString;
            }

            return substr($recipientsString, 0, 12) .  '...';
        }

        return '';
    }
1258182
public function map(array &$row)
    {
        $inputs = $this->parse($this->inputsParams, $row);
        $outputs = $this->parse($this->outputParams, $row);


        return $inputs && $outputs ? [$inputs, $outputs] : null;
    }
971873
private function convertColumns(array $row)
    {
        $result = [];

        foreach ($row as $fieldName => $value) {
            if (is_null($value)) {
                $result[$fieldName] = null;
                continue;
            }
            switch($this->columnTypes[$fieldName]) {
                case self::BOOL:
                    $value = is_null($value) ? null : $value == 't';
                    break;
                case self::INTEGER:
                case self::SMALLINT:
                case self::BIGINT:
                    $value = (int) $value;
                    break;
                case self::NUMERIC:
                    $value = (float) $value;
                    break;
                case self::JSON:
                    $value = json_decode($value, true);
                    break;
                case self::HSTORE:
                    $value = self::fromHStore($value);
                    break;
                case self::DATE:
                case self::TIMESTAMP:
                case self::TIMESTAMPTZ:
                    $value = self::fromTimestamp($value);
                    break;
                case self::SMALLINT_ARRAY:
                case self::INTEGER_ARRAY:
                    $value = self::fromArray($value);
                    if (!is_null($value)) {
                        $value = array_map(function($a) {
                            return $a === 'NULL' ? null : intval($a);
                        }, $value);
                    }
                    break;
                case self::BIGINT_ARRAY:
                case self::NUMERIC_ARRAY:
                    $value = self::fromArray($value);
                    if (!is_null($value)) {
                        $value = array_map(function($a) {
                            return $a === 'NULL' ? null : doubleval($a);
                        }, $value);
                    }
                    break;
                case self::TEXT_ARRAY:
                case self::VARCHAR_ARRAY:
                case self::CHAR_ARRAY:
                    $value = self::fromArray($value);
                    break;
                case self::HSTORE_ARRAY:
                    $array = self::fromArray($value);
                    $value = [];
                    foreach ($array as $val) {
                        $value[] = self::fromHStore($val);
                    }
                    break;
                case self::JSON_ARRAY:
                    $array = self::fromArray($value);
                    $value = [];
                    foreach ($array as $val) {
                        $value[] = json_decode($val, true);
                    }
                    break;
                case self::INTERVAL:
                    $value = self::fromInterval($value);
                    break;
            }

            $result[$fieldName] = $value;
        }
        return $result;
    }
476895
public function writeRow($row)
    {
        if (is_string($row)) {
            $row = explode(',', $row);
            $row = array_map('trim', $row);
        }

        return $this->getHandle()->fputcsv($row, $this->delimiter, $this->enclosure);
    }