Response data status labels setter.

@param mixed[] $data Response data
@param int $index Status column index
@return mixed[]
173049
public static function setStatusLabels(array $data, int $index) : array
    {
        $view = new View();
        $statusLabels = [
            ImportResultsTable::STATUS_SUCCESS => 'success',
            ImportResultsTable::STATUS_PENDING => 'warning',
            ImportResultsTable::STATUS_FAIL => 'danger'
        ];
        foreach ($data as $key => $value) {
            $data[$key][$index] = $view->Html->tag('span', $value[$index], [
                'class' => 'label label-' . $statusLabels[$value[$index]]
            ]);
        }

        return $data;
    }
891898
protected function getColumnNameByIndex($index)
    {
        $name = (isset($this->columns[$index]) && $this->columns[$index] != '*')
            ? $this->columns[$index] : $this->getPrimaryKeyName();

        return in_array($name, $this->extraColumns, true) ? $this->getPrimaryKeyName() : $name;
    }
1009916
function getIndicesFromArrayResponse($indices)
    {

        foreach ($indices as $row) {

            if (in_array($row['index'], array_keys(config("es.indices")))) {
                $row = array_prepend($row, "yes");
            } else {
                $row = array_prepend($row, "no");
            }

            $data[] = $row;

        }

        return $data;

    }
622456
public function getColumnByIndex($index)
    {
        $keys = array_keys($this->columns);
        if (empty($keys[$index]) || empty($column = $this->columns[$keys[$index]])) {
            throw new \InvalidArgumentException('Table don\'t have a column index : ' . $index);
        }

        return $column;
    }
149912
public function update($index, $type, $id, $data, $options = [])
    {
        $body = [
            'doc' => empty($data) ? new \stdClass() : $data,
        ];
        if (isset($options["detect_noop"])) {
            $body["detect_noop"] = $options["detect_noop"];
            unset($options["detect_noop"]);
        }

        return $this->db->post([$index, $type, $id, '_update'], $options, Json::encode($body));
    }
223132
public function checkResponseIntegrity(array $data)
    {
        if (!isset($data['signature'])) {
            return false;
        }

        return $data['vads_site_id'] === (string)$this->config['site_id']
            && $data['vads_ctx_mode'] === (string)$this->config['ctx_mode']
            && $data['signature'] === $this->generateSignature($data);
    }
245583
public function indexed($indexed) {
		if($indexed === true or $indexed === false) {
			$this->data['indexed'] = ($indexed) ? 'YES' : 'NO';	
		} else {
			$this->data['indexed'] = $indexed;
		}
		return $this;
	}
1008047
public function getByIndex($index)
    {
        if (isset($this->elements[$index])) {
            return $this->elements[$index];
        }

        return null;
    }
100885
public function farray_fieldnames($index=null) {
		$retval = null;
		if(is_object($this->sth)) {
			$oData = $this->sth->fetchAll(\PDO::FETCH_ASSOC);
			
			$retval = array();
			
			if($this->numRows > 0) {
				$retval = $oData;
				
				if(!is_null($index)) {
					$newData = array();
					foreach($oData as $rowData) {
						if(isset($rowData[$index])) {
							if(!isset($newData[$rowData[$index]])) {
								$newData[$rowData[$index]] = $rowData;
							}
							else {
								// TODO: maybe this should be a warning (or *can* be, based on a configuration directive).
								throw new \Exception(__METHOD__ .': duplicate records exist for index=('. $index .'), first duplicate was ('. $rowData[$index] .')');
							}
						}
						else {
							throw new \Exception(__METHOD__ .": record does not contain column '". $index ."'");
						}
					}
					$retval = $newData;
				}
			}
			else {
				// no rows!
				$retval = array();
			}
		}
		else {
			throw new \Exception(__METHOD__ .': statement handle was not created');
		}
		return($retval);
	}
1127335
public function label(int $index)
    {
        if (!isset($this->labels[$index])) {
            throw new InvalidArgumentException("Row at offset $index"
                . ' does not exist.');
        }

        return $this->labels[$index];
    }
1228100
public function offsetGet($index)
    {
        if (!array_key_exists($index, $this->data)) {
            throw InvalidArgumentException::format(
                    'Invalid array object index: expecting one of (%s), %s given',
                    Debug::formatValues(array_keys($this->data)), is_string($index) ? "'{$index}'" : $index
            );
        }

        return $this->data[$index];
    }
988176
protected function map($index) // -> int
	{
		$r = $index;
		
		if( (null !== $index) && is_integer($index))
		{
			$r    = $index + $this->start;
			$size = $this->data->getSize();
			
			if($r >= $size)
			{
				$r -= $size;
			}
		}
		
		return $r;
	}
318202
public function offsetGet($index)
    {
        foreach ((array)$this as $i => $element) {
            $i = (string)$i;
            if (is_string($element)) {
                continue;
            }
            if ($element instanceof Label
                && ($element->getElement()->name() == $index
                    || $i == $index
                )
            ) { 
                return $element;
            }
            if ($element->name() == $index || $i == $index) {
                return $element;
            }
            if ($element instanceof Element\Group
                and $found = $element[$index]
            ) {
                return $found;
            }
        }
        return null;
    }
480789
public static function getColumn(array $array, $index)
	{
		$result = array();

		foreach ($array as $item)
		{
			if (is_array($item) && isset($item[$index]))
			{
				$result[] = $item[$index];
			}
			elseif (is_object($item) && isset($item->$index))
			{
				$result[] = $item->$index;
			}
		}

		return $result;
	}
29263
public function getPaymentAmountInfo($index = 0)
    {
        $orderStatuses = $this->getOrderStatuses();
        return array_key_exists('paymentAmountInfo', $orderStatuses[$index])
            ? $orderStatuses[$index]['paymentAmountInfo'] : [];
    }
691863
public function getValidationByIndex($index)
    {
        //check whether worksheet name is set or not
        if ($this->worksheetName == '')
            throw new Exception('Worksheet name not specified');
        $strURI = Product::$baseProductUri . '/cells/' . $this->getFileName() .
            '/worksheets/' . $this->worksheetName . '/validations/' . $index;
        $signedURI = Utils::sign($strURI);
        $responseStream = Utils::processCommand($signedURI, 'GET', '', '');
        $json = json_decode($responseStream);
        return $json->Validation;

    }
1008875
protected function renderColumn($column, $index)
    {
        if (is_string($this->template)) {
            return strtr($this->template, [
                '{label}' => $column->renderHeaderCell(),
                '{value}' => $column->renderDataCell($this->model, $this->model->getPrimaryKey(), 0),
            ]);
        }

        return call_user_func($this->template, $column, $index, $this);
    }