Documentation

Row extends AbstractGateway
in package
implements ArrayAccess, Countable, IteratorAggregate

Row gateway class

Tags
category

Pop

author

Nick Sagona, III dev@nolainteractive.com

copyright

Copyright (c) 2009-2024 NOLA Interactive, LLC. (http://www.nolainteractive.com)

license

http://www.popphp.org/license New BSD License

version
6.5.0

Table of Contents

Interfaces

ArrayAccess
Countable
IteratorAggregate

Properties

$columns  : array<string|int, mixed>
Row column values
$dirty  : array<string|int, mixed>
Row fields that have been changed
$primaryKeys  : array<string|int, mixed>
Primary keys
$primaryValues  : array<string|int, mixed>
Primary values
$table  : string|null
Table

Methods

__construct()  : mixed
Constructor
__get()  : mixed
Magic method to return the value of $this->columns[$name].
__isset()  : bool
Magic method to return the isset value of $this->columns[$name].
__set()  : void
Magic method to set the property to the value of $this->columns[$name].
__unset()  : void
Magic method to unset $this->columns[$name].
count()  : int
Method to get the count of items in the row
delete()  : Row
Delete row from the table using the primary key(s)
doesPrimaryCountMatch()  : bool
Determine if number of primary keys and primary values match
find()  : array<string|int, mixed>
Find row by primary key values
getColumns()  : array<string|int, mixed>
Get the columns
getDirty()  : array<string|int, mixed>
Get dirty columns
getIterator()  : ArrayIterator
Method to iterate over the columns
getPrimaryKeys()  : array<string|int, mixed>
Get the primary keys
getPrimaryValues()  : array<string|int, mixed>
Get the primary values
getTable()  : string
Get the table name
getTableInfo()  : array<string|int, mixed>
Get table info
isDirty()  : bool
Check if row data is dirty
offsetExists()  : bool
ArrayAccess offsetExists
offsetGet()  : mixed
ArrayAccess offsetGet
offsetSet()  : void
ArrayAccess offsetSet
offsetUnset()  : void
ArrayAccess offsetUnset
resetDirty()  : Row
Reset dirty columns
save()  : Row
Save a new row in the table
setColumns()  : Row
Set the columns
setPrimaryKeys()  : Row
Set the primary keys
setPrimaryValues()  : Row
Set the primary values
toArray()  : array<string|int, mixed>
Method to convert row gateway to an array
update()  : Row
Update an existing row in the table

Properties

$columns

Row column values

protected array<string|int, mixed> $columns = []

$dirty

Row fields that have been changed

protected array<string|int, mixed> $dirty = ['old' => [], 'new' => []]

$primaryKeys

Primary keys

protected array<string|int, mixed> $primaryKeys = []

$primaryValues

Primary values

protected array<string|int, mixed> $primaryValues = []

Methods

__construct()

Constructor

public __construct(string $table[, mixed $primaryKeys = null ]) : mixed

Instantiate the row gateway object.

Parameters
$table : string
$primaryKeys : mixed = null

__get()

Magic method to return the value of $this->columns[$name].

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

__isset()

Magic method to return the isset value of $this->columns[$name].

public __isset(string $name) : bool
Parameters
$name : string
Return values
bool

__set()

Magic method to set the property to the value of $this->columns[$name].

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

__unset()

Magic method to unset $this->columns[$name].

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

count()

Method to get the count of items in the row

public count() : int
Return values
int

doesPrimaryCountMatch()

Determine if number of primary keys and primary values match

public doesPrimaryCountMatch() : bool
Tags
throws
Exception
Return values
bool

find()

Find row by primary key values

public find(mixed $values[, array<string|int, mixed> $selectColumns = [] ][, array<string|int, mixed>|null $options = null ]) : array<string|int, mixed>
Parameters
$values : mixed
$selectColumns : array<string|int, mixed> = []
$options : array<string|int, mixed>|null = null
Tags
throws
Exception|Exception
Return values
array<string|int, mixed>

getColumns()

Get the columns

public getColumns() : array<string|int, mixed>
Return values
array<string|int, mixed>

getDirty()

Get dirty columns

public getDirty() : array<string|int, mixed>
Return values
array<string|int, mixed>

getIterator()

Method to iterate over the columns

public getIterator() : ArrayIterator
Return values
ArrayIterator

getPrimaryKeys()

Get the primary keys

public getPrimaryKeys() : array<string|int, mixed>
Return values
array<string|int, mixed>

getPrimaryValues()

Get the primary values

public getPrimaryValues() : array<string|int, mixed>
Return values
array<string|int, mixed>

getTable()

Get the table name

public getTable() : string
Return values
string

isDirty()

Check if row data is dirty

public isDirty() : bool
Return values
bool

offsetExists()

ArrayAccess offsetExists

public offsetExists(mixed $offset) : bool
Parameters
$offset : mixed
Return values
bool

offsetGet()

ArrayAccess offsetGet

public offsetGet(mixed $offset) : mixed
Parameters
$offset : mixed

offsetSet()

ArrayAccess offsetSet

public offsetSet(mixed $offset, mixed $value) : void
Parameters
$offset : mixed
$value : mixed

offsetUnset()

ArrayAccess offsetUnset

public offsetUnset(mixed $offset) : void
Parameters
$offset : mixed

resetDirty()

Reset dirty columns

public resetDirty() : Row
Return values
Row

save()

Save a new row in the table

public save([array<string|int, mixed> $columns = [] ]) : Row
Parameters
$columns : array<string|int, mixed> = []
Return values
Row

setColumns()

Set the columns

public setColumns([array<string|int, mixed> $columns = [] ]) : Row
Parameters
$columns : array<string|int, mixed> = []
Return values
Row

setPrimaryKeys()

Set the primary keys

public setPrimaryKeys(mixed $keys) : Row
Parameters
$keys : mixed
Return values
Row

setPrimaryValues()

Set the primary values

public setPrimaryValues(mixed $values) : Row
Parameters
$values : mixed
Return values
Row

toArray()

Method to convert row gateway to an array

public toArray() : array<string|int, mixed>
Return values
array<string|int, mixed>

        
On this page

Search results