undocumented function

@param string The Excel column letter
@param array An array of values
@return Success
181367
public function setColumn($col, $values)
    {
        if (!\is_array($values)) {
            \trigger_error("Values must be an array.", E_USER_ERROR);
            return false;
        }
        if (\is_numeric($col)) {
            \trigger_error("Column must be a letter, eg column D.", E_USER_ERROR);
            return false;
        }

        //todo check array
        $i = 0;
        foreach ($values as $value) {
            $this->setCell($col . ($i + 1), $value);
            $i++;
        }

        return true;
    }
634065
private static function _vlookupSort($a,$b) {
		$f = array_keys($a);
		$firstColumn = array_shift($f);
		if (strtolower($a[$firstColumn]) == strtolower($b[$firstColumn])) {
			return 0;
		}
		return (strtolower($a[$firstColumn]) < strtolower($b[$firstColumn])) ? -1 : 1;
	}
646862
public static function column(array $array, $column_key)
    {
        $retarr = [];
        foreach ($array as $arr) {
            if (is_array($column_key)) {
                $ret = [];
                foreach ($column_key as $key) {
                    $ret[] = isset($arr[$key]) ? $arr[$key] : null;
                }
                $retarr[] = $ret;
            } else {
                $retarr[] = $arr[$column_key];
            }
        }
        return $retarr;
    }
1202297
public static function columnToKey(array $array, $keyColumn, $valueColumn = null): array
    {
        $keys = array_column($array, $keyColumn);
        $values = null === $valueColumn ? $array : array_column($array, $valueColumn);

        return array_combine($keys, $values);
    }
98240
private static function executeTableShowTableColumn(array $column, $value): void
  {
    $spaces = str_repeat(' ', $column['length'] - mb_strlen((string)$value));

    switch ($column['type'])
    {
      case 1: // tinyint
      case 2: // smallint
      case 3: // int
      case 4: // float
      case 5: // double
      case 8: // bigint
      case 9: // mediumint
      case 246: // decimal
        echo ' ', $spaces.$value, ' ';
        break;

      case 7: // timestamp
      case 10: // date
      case 11: // time
      case 12: // datetime
      case 13: // year
      case 16: // bit
      case 252: // is currently mapped to all text and blob types (MySQL 5.0.51a)
      case 253: // varchar
      case 254: // char
        echo ' ', $value.$spaces, ' ';
        break;

      default:
        throw new FallenException('data type id', $column['type']);
    }
  }
1099259
public function toSheet($array, $sheet_name, $ext=false)
  {
    if(!$ext){
      $ext=pathinfo($sheet_name, PATHINFO_EXTENSION);  
    }
    switch ($ext) {
      case 'csv':
      $writer = WriterFactory::create(Type::CSV);
      break;
      case 'ods':
      $writer = WriterFactory::create(Type::ODS);
      break;
      case 'xlsx':
      $writer = WriterFactory::create(Type::XLSX);
      break;
    }
    @$writer->openToFile($sheet_name);
    foreach ($array as $row) {
      $writer->addRow($row);
    }
    if (is_null($writer->close())) {
      return true;
    } else {
      return false;
    }
  }
1030744
public function drop($columns)
    {
        if (!is_array($columns)) {
            $columns = [$columns];
        }

        $this->compileWheres();
        $result = $this->query->replace(function ($doc) use ($columns) {
            return $doc->without($columns);
        })->run();

        return 0 == (int) $result['errors'];
    }
553325
public static function arrayToCsv($array, $header_row = true, $col_sep = ",", $row_sep = "\n", $qut = '"')
    {
        if (!is_array($array) || !isset($array[0]) || !is_array($array[0])) {
            return false;
        }
        $output = '';
        if ($header_row) {
            foreach ($array[0] as $key => $val) {
                $key = str_replace($qut, "$qut$qut", $key);
                $output .= "$col_sep$qut$key$qut";
            }
            $output = substr($output, 1)."\n";
        }
        foreach ($array as $key => $val) {
            $tmp = '';
            foreach ($val as $cell_key => $cell_val) {
                $cell_val = str_replace($qut, "$qut$qut", $cell_val);
                $tmp .= "$col_sep$qut$cell_val$qut";
            }
            $output .= substr($tmp, 1).$row_sep;
        }

        return $output;
    }
50001
public static function make_assoc($columns, $array)
	{
		/* init the array */
		$assoc = array();

		/* set the cursor to */
		$cursor = 0;

		/* itterate over the data, and combine the data */
		foreach ($array as $record)
		{
			foreach ($record as $key => $value)
			{
				$assoc[$cursor][$columns[$key]] = $value;
			}
			$cursor++;
		}

		return $assoc;
	}
754816
private function doInsert(array $values) {
        $db       = $this->db();
        $mapping  = $this->dao()->getMapping();
        $table    = $mapping['table'];
        $idColumn = $mapping['identity']['column'];
        $id       = null;
        if  (isset($values[$idColumn])) $id = $values[$idColumn];
        else unset($values[$idColumn]);

        // translate column values
        foreach ($values as &$value) {
            $value = $db->escapeLiteral($value);
        }; unset($value);

        // create SQL statement
        $sql = 'insert into '.$table.' ('.join(', ', \array_keys($values)).')
                   values ('.join(', ', $values).')';

        // execute SQL statement
        if ($id) {
            $db->execute($sql);
        }
        else if ($db->supportsInsertReturn()) {
            $id = $db->query($sql.' returning '.$idColumn)->fetchInt();
        }
        else {
            $id = $db->execute($sql)->lastInsertId();
        }
        return $id;
    }
609680
public function join(array $array)
    {
        $function = $this->_function;
        $valuesFunction = $this->_valuesFunction;
        $result = '';
        foreach ($array as $key => $value) {
            if (!$this->_skipNulls || ($this->_skipNulls && $value)) {
                $result .= (
                    $function ? $function($key, $value) :
                        ($valuesFunction ? $valuesFunction($value) : $value)
                    ) . $this->_separator;
            }
        }
        return rtrim($result, $this->_separator);
    }
777465
public static function str_safe_html(&$array)
    {
        if (is_array($array)) {
            foreach ($array as $key => $value) {
                if (!is_array($value)) {
                    //&,",',> ,< 转为html实体 &amp;,&quot;&#039;,&gt;,&lt;
                    $array[$key] = htmlspecialchars($value,ENT_QUOTES);
                } else {
                    self::str_safe_html($array[$key]);
                }
            }
        } else {
            $array = htmlspecialchars($array,ENT_QUOTES);
        }
    }
756916
public static function values2csv(array $array, $separator = ',')
    {
        /*
         * No elements?
         * Nothing to do
         */
        if (empty($array)) {
            return null;
        }

        $rows = [];
        $lineSeparator = "\n";

        foreach ($array as $row) {
            /*
             * I have to use html_entity_decode() function here, because some string values can contain
             * entities with semicolon and this can destroy the CSV column order.
             */

            if (is_array($row) && !empty($row)) {
                foreach ($row as $key => $value) {
                    $row[$key] = html_entity_decode($value);
                }

                $rows[] = implode($separator, $row);
            }
        }

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

        return implode($lineSeparator, $rows);
    }
456640
public function groupBy($array, $columns)
    {
        // ensure $columns parameter is array
        $columns = (array) $columns;

        // get first group-by column
        $col = array_shift($columns);

        $result = array();
        foreach ($array as $row) {
            $key = (string) is_object($row) ? $row->$col : $row[$col];
            if (!isset($result[$key])) {
                $result[$key] = array();
            }

            $result[$key][] = $row;
        }

        // do subsequent group by calls
        if (count($columns)) {
            foreach (array_keys($result) as $key) {
                $result[$key] = $this->groupBy($result[$key], $columns);
            }
        }

        return $result;
    }
348046
function _cellToPackedRowcol($cell)
    {
        $cell = strtoupper($cell);
        list($row, $col, $row_rel, $col_rel) = $this->_cellToRowcol($cell);
        if ($col >= 256) {
            return $this->raiseError("Column in: $cell greater than 255");
        }
        // FIXME: change for BIFF8
        if ($row >= 16384) {
            return $this->raiseError("Row in: $cell greater than 16384 ");
        }

        // Set the high bits to indicate if row or col are relative.
        if ($this->_BIFF_version == 0x0500) {
            $row    |= $col_rel << 14;
            $row    |= $row_rel << 15;
            $col     = pack('C', $col);
        } elseif ($this->_BIFF_version == 0x0600) {
            $col    |= $col_rel << 14;
            $col    |= $row_rel << 15;
            $col     = pack('v', $col);
        }
        $row     = pack('v', $row);

        return array($row, $col);
    }
1051906
public static function delete(&$array, $key)
	{
		if (is_null($key))
		{
			return false;
		}

		if (is_array($key))
		{
			$return = array();
			foreach ($key as $k)
			{
				$return[$k] = static::delete($array, $k);
			}
			return $return;
		}

		$key_parts = explode('.', $key);

		if (! is_array($array) or ! array_key_exists($key_parts[0], $array))
		{
			return false;
		}

		$this_key = array_shift($key_parts);

		if (! empty($key_parts))
		{
			$key = implode('.', $key_parts);
			return static::delete($array[$this_key], $key);
		}
		else
		{
			unset($array[$this_key]);
		}

		return true;
	}
213645
function _cellToPackedRowcol($cell)
	{
		$cell = strtoupper($cell);
		list($row, $col, $row_rel, $col_rel) = $this->_cellToRowcol($cell);
		if ($col >= 256) {
			throw new PHPExcel_Writer_Exception("Column in: $cell greater than 255");
		}
		if ($row >= 65536) {
			throw new PHPExcel_Writer_Exception("Row in: $cell greater than 65536 ");
		}

		// Set the high bits to indicate if row or col are relative.
		$col |= $col_rel << 14;
		$col |= $row_rel << 15;
		$col = pack('v', $col);

		$row = pack('v', $row);

		return array($row, $col);
	}