menu

Adianti Solutions

API

Adianti, Framework, PHP, MVC, Active record, Front controller, IDE, RAD, Web, multiplataforma, geração de código, desenvolvimento rápido, relatórios, formulários, listagens, datagrids, gráficos, banco de dados, padrões de projeto, design patterns API do Adianti Framework.
API Docs
code
Selecione a classe

Class TRepository

Description

Implements the Repository Pattern to deal with collections of Active Records

Located in /database/TRepository.php (line 24)


	
			
Variable Summary
mixed $class
mixed $columns
mixed $criteria
mixed $setValues
Method Summary
__construct ($class)
count ([$criteria = NULL])
delete ([$criteria = NULL], [$callObjectLoad = FALSE])
filter (Callable$callback, [$callObjectLoad = TRUE])
first ([$callObjectLoad = TRUE])
get ([$criteria = NULL], [$callObjectLoad = TRUE])
getIndexedArray ($indexColumn, $valueColumn, [$criteria = NULL])
load ([$criteria = NULL], [$callObjectLoad = TRUE])
orderBy ($order, [$direction = 'asc'])
orWhere ($variable, $operator, $value)
select ($columns)
set ($column, $value)
skip ($offset)
take ($limit)
transform (Callable$callback, [$callObjectLoad = TRUE])
update ([$setValues = NULL], [$criteria = NULL])
where ($variable, $operator, $value, [$logicOperator = TExpression::AND_OPERATOR])
Variables
mixed $class (line 26)
  • access: protected
mixed $columns (line 29)
  • access: protected
mixed $criteria (line 27)
  • access: protected
mixed $setValues (line 28)
  • access: protected
Methods
Constructor __construct (line 35)

Class Constructor

  • access: public
__construct ($class)
  • $class: = Active Record class name
count (line 493)

Return the amount of objects that satisfy a given criteria

  • return: Integer containing the amount of objects that satisfy the criteria
  • access: public
count ([$criteria = NULL])
  • $criteria: An TCriteria object, specifiyng the filters
delete (line 399)

Delete a collection of Active Records from database

  • return: affected rows
  • access: public
delete ([$criteria = NULL], [$callObjectLoad = FALSE])
  • $criteria: An TCriteria object, specifiyng the filters
  • $callObjectLoad
filter (line 578)

Returns filtered collection

  • access: public
filter (Callable$callback, [$callObjectLoad = TRUE])
  • Callable$callback
  • $callObjectLoad
first (line 548)

Returns the first collection item

  • access: public
first ([$callObjectLoad = TRUE])
  • $callObjectLoad
get (line 540)

Alias for load()

  • access: public
get ([$criteria = NULL], [$callObjectLoad = TRUE])
  • $criteria
  • $callObjectLoad
getAttributeList (line 67)

Get attribute list from entity

  • access: protected
getAttributeList ()
getEntity (line 59)

Returns the name of database entity

  • return: String containing the name of the entity
  • access: protected
getEntity ()
getIndexedArray (line 276)

Return a indexed array

  • access: public
getIndexedArray ($indexColumn, $valueColumn, [$criteria = NULL])
  • $indexColumn
  • $valueColumn
  • $criteria
load (line 184)

Load a collection of objects from database using a criteria

  • return: array containing the Active Records
  • access: public
load ([$criteria = NULL], [$callObjectLoad = TRUE])
  • $criteria: An TCriteria object, specifiyng the filters
  • $callObjectLoad: If load() method from Active Records must be called to load object parts
loadStatic (line 268)

Load with no aggregates

  • access: public
loadStatic ()
orderBy (line 144)

Define the ordering for criteria using fluent interfaces

  • return: TRepository object
  • access: public
orderBy ($order, [$direction = 'asc'])
  • $order: = Order column
  • $direction: = Order direction (asc, desc)
orWhere (line 130)

Add a run time OR criteria using fluent interfaces

  • return: TRepository object
  • access: public
orWhere ($variable, $operator, $value)
  • $variable: = variable
  • $operator: = comparison operator (>,<,=)
  • $value: = value to be compared
select (line 83)

Define columns list

  • access: public
select ($columns)
  • $columns
set (line 112)

Assign values to the database columns

  • return: TRepository object
  • access: public
set ($column, $value)
  • $column: = column name
  • $value: = column value
skip (line 171)

Define the OFFSET criteria using fluent interfaces

  • return: TRepository object
  • access: public
skip ($offset)
  • $offset: = Offset
take (line 158)

Define the LIMIT criteria using fluent interfaces

  • return: TRepository object
  • access: public
take ($limit)
  • $limit: = Limit
transform (line 560)

Returns transformed collection

  • access: public
transform (Callable$callback, [$callObjectLoad = TRUE])
  • Callable$callback
  • $callObjectLoad
update (line 303)

Update values in the repository

  • access: public
update ([$setValues = NULL], [$criteria = NULL])
  • $setValues
  • $criteria
where (line 98)

Add a run time criteria using fluent interfaces

  • return: TRepository object
  • access: public
where ($variable, $operator, $value, [$logicOperator = TExpression::AND_OPERATOR])
  • $variable: = variable
  • $operator: = comparison operator (>,<,=)
  • $value: = value to be compared
  • $logicOperator: = logical operator (TExpression::AND_OPERATOR, TExpression::OR_OPERATOR)