Skip to content

ColumnRepresentation

A special Select object restricted to a single column, implementing extra columns manipulation methods.

Properties

columnIndex

php
protected \WeakReference $columnIndex

Methods

__construct

php
public __construct(\MammothPHP\WoollyM\ColumnIndex $columnIndex): mixed

Parameters:

ParameterTypeDescription
$columnIndex\MammothPHP\WoollyM\ColumnIndex

isAlive

php
public isAlive(): bool

getName

Return the column name

php
public getName(): string

Throws:


getSelect

php
public getSelect(): array

__toString

php
public __toString(): string

type

Convert all colonne data to a specified type

php
public type(\MammothPHP\WoollyM\DataType $type, array|string|null $fromDateFormat = null, ?string $toDateFormat = null): self

Parameters:

ParameterTypeDescription
$type\MammothPHP\WoollyM\DataType
$fromDateFormatarray|string|null
$toDateFormat?string

enforceType

php
public enforceType(?\MammothPHP\WoollyM\DataType $type): self

Parameters:

ParameterTypeDescription
$type?\MammothPHP\WoollyM\DataType

Throws:


remove

Remove the column from DataFrame

php
public remove(): void

Throws:


rename

Rename column

php
public rename(string $to): self

Parameters:

ParameterTypeDescription
$tostring

Throws:


set

Set a value or apply a closure to all value selected.

php
public set(mixed $set): self

Parameters:

ParameterTypeDescription
$setmixed- 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): void

Parameters:

ParameterTypeDescription
$dfmixed- Single column dataFrame

Throws:


apply

Apply a closure return to all selected elements.

php
public apply(\Closure $f): void

Parameters:

ParameterTypeDescription
$f\Closure

Throws:


setColumnValue

Set value to all selected elements.

php
public setColumnValue(mixed $value): void

Parameters:

ParameterTypeDescription
$valuemixed

Throws:


Inherited methods

record

Get a record by key

php
public record(int $key): \MammothPHP\WoollyM\Record

Parameters:

ParameterTypeDescription
$keyint

export

Export Selection as a new Dataframe object

php
public export(): \MammothPHP\WoollyM\DataFrame

Throws:


groupBy

php
public groupBy(string|\MammothPHP\WoollyM\Stats\AggProvider $args): \MammothPHP\WoollyM\DataFrame

Parameters:

ParameterTypeDescription
$argsstring|\MammothPHP\WoollyM\Stats\AggProvider

toArray

Get selection as PHP array

php
public toArray(): array<int,array>

countRecords

Count Records in statement

php
public countRecords(): int


Automatically generated on 2024-07-03

Released under the BSD 3-Clause License.