Overview

Namespaces

  • mechanicious
    • Columnizer
    • Extensions
      • Bs3Table
    • Support
    • Tableman
    • TablemanExtension
    • Test
      • Tableman
  • PHP

Classes

  • Tableman
  • TablemanCollection
  • Overview
  • Namespace
  • Class
  • Tree

Class Tableman

Tableman Provides a convenient API for manipulation and creation of tables.

Illuminate\Support\Collection
Extended by mechanicious\Tableman\TablemanCollection
Extended by mechanicious\Tableman\Tableman uses mechanicious\Support\ArrayableTrait
Namespace: mechanicious\Tableman
Located at mechanicious/Tableman/Tableman.php
Methods summary
public
# __construct( mechanicious\Columnizer\ColumnBag $cols )
public string
# getJson( mixed $format = 'column' )

Get JSON representation of the data

Get JSON representation of the data

Returns

string
public mixed
# withdraw( closure $callback )

Returns whatever the callback function returns

Returns whatever the callback function returns

Parameters

$callback
closure
$callback

Returns

mixed
public mechanicious\Tableman\Tableman
# sortColumns( closure $callback )

Sort columns with a callback function

Sort columns with a callback function

Parameters

$callback
closure
$callback

Returns

mechanicious\Tableman\Tableman

Callback

function($previous, $current) {// -1, 0, 1}

Usage

http://php.net/manual/en/function.uasort.php#refsect1-function.uasort-parameters
public mechanicious\Tableman\Tableman
# reverse( )

Reverse the order of columns

Reverse the order of columns

Returns

mechanicious\Tableman\Tableman
public mechanicious\Tableman\Tableman
# reverseColumns( )

Reverse the order of columns, alias of Tableman::reverse

Reverse the order of columns, alias of Tableman::reverse

Returns

mechanicious\Tableman\Tableman
public mechanicious\Tableman\Tableman
# orderColumns( array $order = array() )

Put columns into a desired order

Put columns into a desired order

Returns

mechanicious\Tableman\Tableman
public array
# getColumns( )

Get the columns

Get the columns

Returns

array
public array
# getColumnOrder( )

Get order of columns

Get order of columns

Returns

array
public array
# getColumnHeaders( )

Get current headers of columns

Get current headers of columns

Returns

array
public boolean
# columnExists( mixed $header )

Check if a column exists

Check if a column exists

Returns

boolean
public boolean
# columnHas( string $header, mixed $needle )

Check if a certain column has a certain value

Check if a certain column has a certain value

Parameters

$header
string
$header
$needle
mixed
$needle

Returns

boolean
public
# addColumn( mechanicious\Columnizer\Column $col, integer $offset )

Add column at a particular offset

Add column at a particular offset

Parameters

$col
mechanicious\Columnizer\Column
$col
$offset
integer
$offset
public mechanicious\Columnizer\Column
# padData( mechanicious\Columnizer\Column $col, mixed $padValue = null )

Symmetrize data if the given column is asymmetric

Symmetrize data if the given column is asymmetric

Parameters

$col
mechanicious\Columnizer\Column
$col
$padValue

Returns

mechanicious\Columnizer\Column
public mechanicious\Tableman\Tableman
# prependColumn( mechanicious\Columnizer\Column $col )

Prepend column

Prepend column

Parameters

$col
mechanicious\Columnizer\Column
$col

Returns

mechanicious\Tableman\Tableman
public mechanicious\Tableman\Tableman
# appendColumn( mechanicious\Columnizer\Column $col )

Append column

Append column

Parameters

$col
mechanicious\Columnizer\Column
$col

Returns

mechanicious\Tableman\Tableman
public mechanicious\Tableman\Tableman
# popColumn( )

Remove the last column

Remove the last column

Returns

mechanicious\Tableman\Tableman
public mechanicious\Tableman\Tableman
# shiftColumn( )

Remove first column

Remove first column

Returns

mechanicious\Tableman\Tableman
public mechanicious\Tableman\Tableman
# removeColumn( string $header )

Remove a column the header

Remove a column the header

Parameters

$header
string
$header

Returns

mechanicious\Tableman\Tableman
public boolean
# compareColumnContent( string $colA, string $colB )

Check if tho columns carry same content

Check if tho columns carry same content

Parameters

$colA
string
$a
$colB
string
$b

Returns

boolean
public mechanicious\Tableman\Tableman
# replaceColumn( mechanicious\Columnizer\Column $col, string $header )

Replace column by another column

Replace column by another column

Parameters

$col
mechanicious\Columnizer\Column
$col
$header
string
$header

Returns

mechanicious\Tableman\Tableman
public mechanicious\Tableman\Tableman
# eachRowOf( closure $header, closure $callback )

Apply a callback on each row belonging to a specified column

Apply a callback on each row belonging to a specified column

Parameters

$header
closure
$callback
$callback

Returns

mechanicious\Tableman\Tableman

Callback

function(&$ref, &$row, $rowIndex) {}
public mechanicious\Tableman\Tableman
# eachRow( closure $callback )

Apply a callback on each row

Apply a callback on each row

Parameters

$callback
closure
$callback

Returns

mechanicious\Tableman\Tableman

Callback

function(&$ref, &$row, $rowIndex) {}
public mechanicious\Tableman\Tableman
# eachCell( closure $callback )

Apply a callback on each cell

Apply a callback on each cell

Parameters

$callback
closure
$callback

Returns

mechanicious\Tableman\Tableman

Callback

function(&$ref, &$cell, &$row, $rowIndex) {}
public mechanicious\Tableman\Tableman
# eachColumn( closure $callback )

Apply a callback on each column

Apply a callback on each column

Parameters

$callback
closure
$callback

Returns

mechanicious\Tableman\Tableman

Callback

function(&$ref, &$column, $header) {}
public mechanicious\Columnizer\Column;
# getColumn( string $header )

Get a column by it's header

Get a column by it's header

Parameters

$header
string
$header

Returns

mechanicious\Columnizer\Column;
public array
# getAllColumns( )

Get columns

Get columns

Returns

array
public array
# getRows( )

Get referenced-rows as an array

Get referenced-rows as an array

Returns

array
public
# renameColumns( array $headers = array() )

Rename Headers

Rename Headers

public
# __call( mixed $name, mixed $args )
Methods inherited from mechanicious\Tableman\TablemanCollection
collapse(), diff(), each(), fetch(), filter(), flatten(), getArrayableItems(), groupBy(), implode(), make()
Methods used from mechanicious\Support\ArrayableTrait
()
Properties summary
protected array $exts array()
#

Holds the extensions

Holds the extensions

API documentation generated by ApiGen 2.8.0