Copied!
CloneableInstantiable
Methods
public PHPFUI\ORM\Table::__construct()
public PHPFUI\ORM\Table::addFind(array $parameters) : PHPFUI\ORM\DataObjectCursor
 
  • param array<string,mixed> $parameters
public PHPFUI\ORM\Table::addGroupBy(string $field, bool $rollup = false) : static
 

Add a valid group field

  • param bool $rollup can be applied to any group by field, but affects the entire group by clause
public PHPFUI\ORM\Table::addJoin(string $table, PHPFUI\ORM\Condition|string $on = '', string $type = 'LEFT', string $as = '') : static
 

Add a join with another table

  • param string $table name of the table to join, case sensitive
  • param string|\PHPFUI\ORM\Condition $on condition.
    • If $on is empty, then the following defaults are tried:
      • Join on the primary key of the join table if it exists on both tables
      • If field does not exist on both tables, then use the primary key of the main table
    • If $on is a non-empty string, use as the join field
    • Use \PHPFUI\ORM\Condition for complex joins
  • param string $type of join (LEFT, INNER, OUTER, RIGHT, FULL, CROSS)
public PHPFUI\ORM\Table::addOrderBy(string $field, string $ascending = 'ASC') : static
public PHPFUI\ORM\Table::addSelect(object|string $field, string $as = '') : static
 

Add a field the the select, must be a valid field

public PHPFUI\ORM\Table::addUnion(PHPFUI\ORM\Table $table, bool $any = false) : static
 

Add table for union.

  • param bool $any if true, adds all records from query, defaults to distinct records only
public static PHPFUI\ORM\Table::capitalSplit(string $key) : string
 

Split a string into words based on capital letters. Successive capital letters are considered an appreviation and grouped together.

public PHPFUI\ORM\Table::cleanField(string $fieldName) : string
public PHPFUI\ORM\Table::count() : int
 

Returns the count for the limited query.

public PHPFUI\ORM\Table::delete(bool $allowDeleteAll = false) : static
 

Delete record matching the requested parameters

public PHPFUI\ORM\Table::displayTransform(string $field, ?mixed $value = NULL) : ?mixed
 

transform any field or table.field from join

public PHPFUI\ORM\Table::find(array $parameters) : PHPFUI\ORM\DataObjectCursor
 
  • param array<string,mixed> $parameters
public static PHPFUI\ORM\Table::getAllTables(array $skipTables = []) : array
 

Get all tables in the application

  • param string[] $skipTables
  • return array<string,\PHPFUI\ORM\Table>
public PHPFUI\ORM\Table::getArrayCursor() : PHPFUI\ORM\ArrayCursor
 

Return a array collection matching the requested parameters

public PHPFUI\ORM\Table::getDataObjectCursor() : PHPFUI\ORM\DataObjectCursor
 

Return a object collection matching the requested parameters

public PHPFUI\ORM\Table::getExplainRows() : array
 

Return an array of the explain query

  • return array<string,mixed>[]
public PHPFUI\ORM\Table::getFields() : array
 
  • return array<string,array>
public PHPFUI\ORM\Table::getGroupBy() : string
 
  • return string the current group by string
public PHPFUI\ORM\Table::getHaving(array $input) : string
 

Return the string starting with "having" for the query

  • param array $input array reference. Current contents will remain, and new contents appended to the array
  • return string " HAVING condition"
public PHPFUI\ORM\Table::getHavingCondition() : PHPFUI\ORM\Condition
public getHighest() : PHPFUI\ORM\Record\Migration
public PHPFUI\ORM\Table::getLastInput() : array
 
  • return array
public PHPFUI\ORM\Table::getLastSql() : string
public PHPFUI\ORM\Table::getLimit() : ?int
 
  • return ?int the current limit
public PHPFUI\ORM\Table::getLimitClause() : string
 
  • return string the current limit string
public PHPFUI\ORM\Table::getOffset() : ?int
public PHPFUI\ORM\Table::getOrderBy() : string
 
  • return string the current order by string
public PHPFUI\ORM\Table::getPage() : int
public PHPFUI\ORM\Table::getPrimaryKeys() : array
 
  • return string[]
public PHPFUI\ORM\Table::getRecord() : PHPFUI\ORM\Record
public PHPFUI\ORM\Table::getRecordCursor() : PHPFUI\ORM\RecordCursor
 

Return a Record collection matching the requested parameters

public PHPFUI\ORM\Table::getRows() : array
 
  • return array<string,string>[] records matching the requested parameters
public PHPFUI\ORM\Table::getSelectFields() : string
 
  • return string the current select string, '*' if nothing specified, or a comma delimited field list
public PHPFUI\ORM\Table::getSelectSQL(array $input, bool $limited = true) : string
 
  • param array $input Sets up lastSql and lastInput variable for use in returning cursors
public PHPFUI\ORM\Table::getTableName() : string
public PHPFUI\ORM\Table::getWhere(array $input) : string
 

Return the string starting with "where" for the query

  • param array $input array reference. Current contents will remain, and new contents appended to the array
  • return string " where condition"
public PHPFUI\ORM\Table::getWhereCondition() : PHPFUI\ORM\Condition
public PHPFUI\ORM\Table::insert(array $records, string $ignore = '') : bool
 

Mass insertion. Does not use a transaction, so surround by a transaction if needed

  • param \PHPFUI\ORM\Record[] $records
  • param string $ignore Pass "ignore" to not error on duplicate records
public PHPFUI\ORM\Table::insertOrIgnore(array $records) : bool
 

Inserts current data into table or ignores duplicate key if found

  • param \PHPFUI\ORM\Record[] $records
public paginate(int $page, int $perPage) : PHPFUI\ORM\ArrayCursor
public PHPFUI\ORM\Table::setDistinct(string $distinct = 'DISTINCT') : static
public PHPFUI\ORM\Table::setFullJoinSelects(bool $fullSelects = true) : static
public PHPFUI\ORM\Table::setGroupBy(string $field, bool $rollup = false) : static
 

Reset to this group by field

  • param bool $rollup can be applied to any group by field, but affects the entire group by clause
public PHPFUI\ORM\Table::setHaving(?PHPFUI\ORM\Condition $condition = NULL) : static
public PHPFUI\ORM\Table::setLimit(int $limit = 20, ?int $page = NULL) : static
 
  • param int $page is zero based, so 0 is the first page, 1 is the second page
public PHPFUI\ORM\Table::setOffset(int $offset) : static
public PHPFUI\ORM\Table::setOrderBy(string $field, string $ascending = 'ASC') : static
public PHPFUI\ORM\Table::setSelectFields(string $clause) : static
 

Set user defined select fields.

public static PHPFUI\ORM\Table::setTranslationCallback(callable $callback) : void
public PHPFUI\ORM\Table::setWhere(?PHPFUI\ORM\Condition $condition = NULL) : static
public PHPFUI\ORM\Table::total() : int
 

Returns the total count for the unlimited query.

public PHPFUI\ORM\Table::translate(string $field = '') : string
 

Translate any valid field. $field must be a valid field, or empty to return the translated table name. Joined fields should be specified as table.field.

public PHPFUI\ORM\Table::update(array $variables) : static
 

Update all record matching the requested parameters with the variables passed

  • param array<string,mixed> $variables key => value array of variables to set
public PHPFUI\ORM\Table::updateFromTable(array $request) : bool
 
  • param array<string,mixed> $request
public PHPFUI\ORM\Table::validateFromTable(array $request) : array
 
  • param array<string,mixed> $request
  • return array<string,string> errors
Properties
protected static string $className = '\PHPFUI\ORM\Record\Migration'
protected string PHPFUI\ORM\Table::$distinct = ''
protected array PHPFUI\ORM\Table::$groupBys = []
 
  • var array<string,bool>
protected ?PHPFUI\ORM\Condition PHPFUI\ORM\Table::$havingCondition = NULL
protected PHPFUI\ORM\Record PHPFUI\ORM\Table::$instance
protected array PHPFUI\ORM\Table::$joins = []
 
  • var array<string,array>
protected array PHPFUI\ORM\Table::$lastInput = []
 
  • var array
protected string PHPFUI\ORM\Table::$lastSql = ''
protected ?int PHPFUI\ORM\Table::$limit = NULL
protected ?int PHPFUI\ORM\Table::$offset = NULL
protected array PHPFUI\ORM\Table::$orderBys = []
 
  • var array<string,string>
protected ?int PHPFUI\ORM\Table::$page = NULL
protected array PHPFUI\ORM\Table::$selects = []
 
  • var array<string,string>
protected array PHPFUI\ORM\Table::$unions = []
 
  • var array<string,array>
protected ?PHPFUI\ORM\Condition PHPFUI\ORM\Table::$whereCondition = NULL
Properties
protected static string $className = '\PHPFUI\ORM\Record\Migration'
Methods
public static PHPFUI\ORM\Table::capitalSplit(string $key) : string
 

Split a string into words based on capital letters. Successive capital letters are considered an appreviation and grouped together.

public static PHPFUI\ORM\Table::getAllTables(array $skipTables = []) : array
 

Get all tables in the application

  • param string[] $skipTables
  • return array<string,\PHPFUI\ORM\Table>
public static PHPFUI\ORM\Table::setTranslationCallback(callable $callback) : void
© 2024 Bruce Wells
Search Namespaces \ Classes
Configuration