Class Constructor
__construct
($class, [$withTrashed = FALSE])
-
$class: = Active Record class name
-
$withTrashed
Aggregate column
aggregate
($function, $column, [$alias = null])
-
$function: Aggregate function (count, sum, min, max, avg)
-
$column
-
$alias
Average aggregate
avgBy
($column, [$alias = null])
-
$column: Column to be aggregated
-
$alias: Column alias
Average aggregate and do another aggregate after
avgByAnd
($column, [$alias = null])
-
$column: Column to be aggregated
-
$alias: Column alias
Return the amount of objects that satisfy a given criteria
count
([$criteria = NULL])
-
$criteria: An TCriteria object, specifiyng the filters
Count aggregate
countBy
($column, [$alias = null])
-
$column: Column to be aggregated
-
$alias: Column alias
Count aggregate and do another aggregate after
countByAnd
($column, [$alias = null])
-
$column: Column to be aggregated
-
$alias: Column alias
Count distinct aggregate
countDistinctBy
($column, [$alias = null])
-
$column: Column to be aggregated
-
$alias
Delete a collection of Active Records from database
delete
([$criteria = NULL], [$callObjectLoad = FALSE])
-
$criteria: An TCriteria object, specifiyng the filters
-
$callObjectLoad
Dump Criteria
dump
([$prepared = FALSE])
Returns filtered collection
filter
(Callable$callback, [$callObjectLoad = TRUE])
-
Callable$callback
-
$callObjectLoad
Returns the first collection item
first
([$callObjectLoad = TRUE])
Alias for load()
get
([$criteria = NULL], [$callObjectLoad = TRUE])
-
$criteria
-
$callObjectLoad
Get attribute list from entity
getAttributeList
()
Returns the name of database entity
getEntity
()
Return a indexed array
getIndexedArray
($indexColumn, [$valueColumn = NULL], [$criteria = NULL])
-
$indexColumn
-
$valueColumn
-
$criteria
Define the group for criteria using fluent interfaces
groupBy
($group)
Returns the last collection item
last
([$callObjectLoad = TRUE])
Load a collection of objects from database using a criteria
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
Load with no aggregates
loadStatic
()
Max aggregate
maxBy
($column, [$alias = null])
-
$column: Column to be aggregated
-
$alias: Column alias
Max aggregate and do another aggregate after
maxByAnd
($column, [$alias = null])
-
$column: Column to be aggregated
-
$alias: Column alias
Min aggregate
minBy
($column, [$alias = null])
-
$column: Column to be aggregated
-
$alias: Column alias
Min aggregate and do another aggregate after
minByAnd
($column, [$alias = null])
-
$column: Column to be aggregated
-
$alias: Column alias
Define the ordering for criteria using fluent interfaces
orderBy
($order, [$direction = 'asc'])
-
$order: = Order column
-
$direction: = Order direction (asc, desc)
Add a run time OR criteria using fluent interfaces
orWhere
($variable, $operator, $value)
-
$variable: = variable
-
$operator: = comparison operator (>,<,=)
-
$value: = value to be compared
Define columns list
select
($columns)
Assign values to the database columns
set
($column, $value)
-
$column: = column name
-
$value: = column value
Set criteria
setCriteria
($criteria)
Define the OFFSET criteria using fluent interfaces
skip
($offset)
Sum aggregate
sumBy
($column, [$alias = null])
-
$column: Column to be aggregated
-
$alias: Column alias
Sum aggregate and do another aggregate after
sumByAnd
($column, [$alias = null])
-
$column: Column to be aggregated
-
$alias: Column alias
Define the LIMIT criteria using fluent interfaces
take
($limit)
Returns transformed collection
transform
(Callable$callback, [$callObjectLoad = TRUE])
-
Callable$callback
-
$callObjectLoad
Update values in the repository
update
([$setValues = NULL], [$criteria = NULL])
Add a run time criteria using fluent interfaces
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)
Set withTrashed using fluent interfaces
withTrashed
()