Overview

Namespaces

  • zsql
  • PHP

Classes

  • Database
  • Delete
  • Expression
  • ExtendedQuery
  • Insert
  • Model
  • Query
  • Result
  • Select
  • Update

Exceptions

  • Exception
  • Overview
  • Namespace
  • Class
  • Tree

Class Model

Namespace: zsql
Located at zsql/Model.php
Methods summary
public
# __construct( zsql\Database $database )

Parameters

$database
Engine\Database
$database
public
# init( )

Post initialization hook

Post initialization hook

public stdClass
# find( mixed $identity )

Find a record by primary key

Find a record by primary key

Parameters

$identity
mixed
$identity

Returns

stdClass
public array
# findMany( array $identities )

Find many records by identity

Find many records by identity

Parameters

$identities
array
$identities

Returns

array
public Engine\Database
# getDatabase( )

Getter method for the database adapter

Getter method for the database adapter

Returns

Engine\Database
public Engine\Model
# setDatabase( zsql\Database $database )

Setter method for the database adapter

Setter method for the database adapter

Parameters

$database
Engine\Database
$database

Returns

Engine\Model
public string
# getTableName( )

Getter method for the $tableName property.

Getter method for the $tableName property.

Returns

string
public Engine\Model
# setTableName( string $table )

Setter method for the $tableName property.

Setter method for the $tableName property.

Parameters

$table
string
$table

Returns

Engine\Model
public string
# getPrimaryKey( )

Getter method for the $primaryKey property

Getter method for the $primaryKey property

Returns

string
public Engine\Model
# setPrimaryKey( string $primaryKey )

Setter method for the $primaryKey property

Setter method for the $primaryKey property

Parameters

$primaryKey
string
$primaryKey

Returns

Engine\Model
public zsql\Select
# select( )

Helper function the provides the \zsql\Select object with the table name pre-populated.

Helper function the provides the \zsql\Select object with the table name pre-populated.

Returns

zsql\Select
public zsql\Insert
# insert( )

Insert a row into the model's table. If no table name is specified an exception will be thrown

Insert a row into the model's table. If no table name is specified an exception will be thrown

Returns

zsql\Insert
public zsql\Update
# update( )

Update existing rows in the model's table. If no table name is specified an exception will be thrown

Update existing rows in the model's table. If no table name is specified an exception will be thrown

Returns

zsql\Update
public zsql\Delete
# delete( )

Deletes existing rows from the model's table. If no table name is specified an exception will be thrown

Deletes existing rows from the model's table. If no table name is specified an exception will be thrown

Returns

zsql\Delete
Properties summary
protected Engine\Database $database
#
protected string $primaryKey
#

Name of the primary key column for a table, if one exists

Name of the primary key column for a table, if one exists

protected string $resultClass
#

Class to use for results

Class to use for results

protected string $tableName
#

Name of the table associated with the model

Name of the table associated with the model

API documentation generated by ApiGen 2.8.0