com\setasign\SetaFramework\Database\Table

Row Class Table Row

File: /SetaFramework/src/Database/Table/Row.php

Class hierarchy

Summary

Properties

$data

protected array Row::$data = array()

$initialData

protected array Row::$initialData = array()

$primaryKeyData

protected ?array Row::$primaryKeyData

$readOnlyColumns

protected array Row::$readOnlyColumns = array()

Methods

__construct()

__get()

public Row::__get (
string $name
): mixed

Returns the value of the column $name

Parameters
$name : string
 
Exceptions

Throws \InvalidArgumentException If column is unknown.

__isset()

public Row::__isset (
string $name
): bool
Parameters
$name : string
 

__set()

public Row::__set (
string $name,
mixed $value
): void

Sets the column $name on the value $value

Parameters
$name : string
 
$value : mixed
 
Exceptions

Throws \InvalidArgumentException If column is unknown.

__unset()

public Row::__unset (
string $name
): void
Parameters
$name : string
 

delete()

public Row::delete (
void
): bool

Deletes the row object.

existsInDatabase()

public Row::existsInDatabase (
void
): bool

Checks whether this row exists in the database.

getEdited()

public Row::getEdited (
void
): array

Checks whether the row object was changed. This don't read from the db again.

getInitial()

public Row::getInitial (
string $name
): mixed

Return the initial data of the row

Parameters
$name : string

ColumnName or AliasName

Exceptions

Throws \InvalidArgumentException

getPrimaryKeyData()

public Row::getPrimaryKeyData (
void
): ?array

Get the primary key data of a row

postDelete()

protected Row::postDelete (
void
): void

postInsert()

protected Row::postInsert (
void
): void

postUpdate()

protected Row::postUpdate (
void
): void

preDelete()

protected Row::preDelete (
void
): void

preInsert()

protected Row::preInsert (
void
): void

preUpdate()

protected Row::preUpdate (
void
): void

processPrimaryKeyData()

protected Row::processPrimaryKeyData (
void
): void

Gets the data for the primary key from its $data

Exceptions

Throws \com\setasign\SetaFramework\Exception If a primary key is missing

reset()

public Row::reset (
void
): void

Resets the row object and read the columns from the database.

save()

public Row::save (
void
): void

Saves the row object.

Exceptions

Throws \com\setasign\SetaFramework\Exception If a primary key is missing

setData()

public Row::setData (
array $data,
?array $allowedColumns = null
): void

Sets multiple columns.

Parameters
$data : array

Associative array(column => value)

$allowedColumns : ?array

Only the values of this array are allowed as keys in $data.

toArray()

public Row::toArray (
void
): array

Returns this row as a array. (column => value)