ColumnRepresentation
A special Select object restricted to a single column, implementing extra columns manipulation methods.
- Full name:
\MammothPHP\WoollyM\Statements\Select\ColumnRepresentation - Parent class:
\MammothPHP\WoollyM\Statements\Select\FixedSelect - This class implements:
\Stringable
Properties
columnIndex
php
protected \WeakReference $columnIndexMethods
__construct
php
public __construct(\MammothPHP\WoollyM\ColumnIndex $columnIndex): mixedParameters:
| Parameter | Type | Description |
|---|---|---|
$columnIndex | \MammothPHP\WoollyM\ColumnIndex |
isAlive
php
public isAlive(): boolgetName
Return the column name
php
public getName(): stringThrows:
getSelect
php
public getSelect(): array__toString
php
public __toString(): stringtype
Convert all colonne data to a specified type
php
public type(\MammothPHP\WoollyM\DataType $type, array|string|null $fromDateFormat = null, ?string $toDateFormat = null): selfParameters:
| Parameter | Type | Description |
|---|---|---|
$type | \MammothPHP\WoollyM\DataType | |
$fromDateFormat | array|string|null | |
$toDateFormat | ?string |
enforceType
php
public enforceType(?\MammothPHP\WoollyM\DataType $type): selfParameters:
| Parameter | Type | Description |
|---|---|---|
$type | ?\MammothPHP\WoollyM\DataType |
Throws:
remove
Remove the column from DataFrame
php
public remove(): voidThrows:
rename
Rename column
php
public rename(string $to): selfParameters:
| Parameter | Type | Description |
|---|---|---|
$to | string |
Throws:
set
Set a value or apply a closure to all value selected.
php
public set(mixed $set): selfParameters:
| Parameter | Type | Description |
|---|---|---|
$set | mixed | - The value to set or the closure to apply. |
Throws:
setDataFrame
Merge DataFrame to the column value from the beginning.
php
private setDataFrame(mixed $df): voidParameters:
| Parameter | Type | Description |
|---|---|---|
$df | mixed | - Single column dataFrame |
Throws:
apply
Apply a closure return to all selected elements.
php
public apply(\Closure $f): voidParameters:
| Parameter | Type | Description |
|---|---|---|
$f | \Closure |
Throws:
setColumnValue
Set value to all selected elements.
php
public setColumnValue(mixed $value): voidParameters:
| Parameter | Type | Description |
|---|---|---|
$value | mixed |
Throws:
Inherited methods
record
Get a record by key
php
public record(int $key): \MammothPHP\WoollyM\RecordParameters:
| Parameter | Type | Description |
|---|---|---|
$key | int |
export
Export Selection as a new Dataframe object
php
public export(): \MammothPHP\WoollyM\DataFrameThrows:
groupBy
php
public groupBy(string|\MammothPHP\WoollyM\Stats\AggProvider $args): \MammothPHP\WoollyM\DataFrameParameters:
| Parameter | Type | Description |
|---|---|---|
$args | string|\MammothPHP\WoollyM\Stats\AggProvider |
toArray
Get selection as PHP array
php
public toArray(): array<int,array>countRecords
Count Records in statement
php
public countRecords(): intAutomatically generated on 2024-07-03