Method |
Description |
|
__call ( $m, $a ) |
To support static operation methods like ::create, ::update, we
can not define methods with the same name, so that
we dispatch these methods from the magic method __call. |
|
__clone ( ) |
|
|
__construct ( mixed $args = null, array $options = [] ) |
The constructor. |
|
__get ( string $key ) |
Get record data, relational records, schema object or
connection object. |
|
__isset ( string $name ) |
Do we have this column ? |
|
__set ( string $name, mixed $value ) |
Set column value. |
|
afterCreate ( array $args ) |
Trigger for after creating new record. |
|
afterDelete ( $args ) |
|
|
afterUpdate ( $args ) |
|
|
asCollection ( ) : LazyRecord\BaseCollection |
Return the collection object of current model object. |
|
asCreateAction ( array $args = [], array $options = [] ) |
|
|
asDeleteAction ( array $args = [], array $options = [] ) |
|
|
asUpdateAction ( array $args = [], array $options = [] ) |
|
|
beforeCreate ( array $args ) : array |
Trigger method for "before creating new record". |
|
beforeDelete ( $args ) |
Trigger method for. |
|
beforeUpdate ( $args ) |
|
|
clear ( ) |
Clear current data stash. |
|
clearInternalCache ( ) |
|
|
columns ( ) |
Get the RuntimeColumn objects from RuntimeSchema object. |
|
count ( ) |
Countable interface |
|
create ( array $args, array $options = [] ) : Result |
Method for creating new record, which is called from
static::create and $record->create. |
|
createOrUpdate ( array $args, array $byKeys = null ) |
Create or update an record by checking
the existence from the $byKeys array
that you defined. |
|
currentUserCan ( CurrentUserInterface $user, string $right, array $args = [] ) |
Provide a basic access controll for model. |
|
dataKeyValue ( ) |
This is for select widget,
returns data key from specific column. |
|
dataLabel ( ) |
This is for select widget,
returns label value from specific column. |
|
dataValue ( ) |
Alias method of $this->dataValue(). |
|
dbPrepareAndExecute ( PDO $conn, $sql, array $args = [] ) : PDOStatement |
We should move this method into connection manager. |
|
dbQuery ( $dsId, string $sql ) : PDOStatement |
get pdo connetion and make a query. |
|
deflate ( ) |
deflate current record data, usually deflate data from database
turns data into objects, int, string (type casting). |
|
deflateData ( array &$args ) : array |
deflate data from database. |
|
delete ( ) : Result |
Delete current record, the record should be loaded already. |
|
display ( string $name ) |
Render readable column value. |
|
fastCreate ( array $args ) |
The fast create method does not reload record from created the primary
key. |
|
fetchManyToManyRelationCollection ( $relationId ) |
|
|
fetchOneToManyRelationCollection ( $relationId ) |
|
|
find ( $pkId ) |
Find record. |
|
findMixinMethodClass ( string $m ) : string |
Find methods in mixin schema classes, methods will be called statically. |
|
flushCache ( ) |
flush internal cache, in php memory. |
|
free ( ) |
|
|
fromArray ( array $array ) |
Create from array. |
|
get ( $key ) |
Get inflate value. |
|
getAlias ( ) |
|
|
getCacheInstance ( ) |
|
|
getCachePrefix ( ) |
|
|
getConnection ( string $dsId = 'default' ) : PDO |
get default connection object (PDO) from connection manager. |
|
getCurrentUser ( ) |
|
|
getData ( ) : array |
get current record data stash. |
|
getDataLabelField ( ) |
|
|
getDataValueField ( ) |
|
|
getDeclareSchema ( ) |
|
|
getInternalCache ( string $key ) : mixed |
get internal cache from php memory. |
|
getIterator ( ) |
===================================== |
|
getLastResult ( ) |
|
|
getQueryDriver ( string $dsId ) |
Get SQL Query Driver by data source id. |
|
getReadConnection ( ) : PDO |
Get PDO connection for reading data. |
|
getReadQueryDriver ( ) : SQLBuilder\QueryDriver |
Get SQL Query driver object for reading data. |
|
getReadSourceId ( ) |
|
|
getRecordActionClass ( $type ) |
|
|
getRelationalRecords ( $key, $relation = null ) |
|
|
getSchema ( ) |
|
|
getSchemaProxyClass ( ) |
|
|
getSelected ( ) |
|
|
getStashedData ( ) |
|
|
getTable ( ) |
|
|
getValue ( string $name ) : mixed |
Get the raw value from record (without deflator). |
|
getWriteConnection ( ) : PDO |
Get PDO connection for writing data. |
|
getWriteQueryDriver ( ) |
Get SQL Query driver object for writing data. |
|
getWriteSourceId ( ) |
|
|
hasInternalCache ( $key ) |
|
|
hasValue ( string $name ) : boolean |
Check if the value exist. |
|
inflateColumnValue ( string $n ) : mixed |
Inflate column value. |
|
invokeAllMixinMethods ( string $m, array $a ) |
Invoke method on all mixin classes statically. this method does not return anything. |
|
invokeMixinClassMethod ( string $mixinClass, string $m, array $a ) : mixed |
Invoke single mixin class method statically,. |
|
load ( $args, array $options = null ) |
|
|
loadFromCache ( $args, $ttl = 3600 ) |
|
|
loadOrCreate ( array $args, array $byKeys = null ) |
Create a record if the record does not exists
Otherwise the record should be updated with the arguments. |
|
loadQuery ( string $sql, array $args = [], string $dsId = null ) : Result |
Load record from an sql query. |
|
lockRead ( $alias = null ) |
|
|
lockWrite ( $alias = null ) |
|
|
newAction ( string $type, array $args = [], $options = [] ) |
Create an action from existing record object. |
|
offsetExists ( $name ) |
|
|
offsetGet ( $name ) |
|
|
offsetSet ( $name, $value ) |
|
|
offsetUnset ( $name ) |
|
|
rawCreate ( array $args ) |
Simply create record without validation and triggers. |
|
rawUpdate ( array $args ) |
Simply update record without validation and triggers. |
|
reload ( string $pkId = null ) |
Relaod record data by primary key,
parameter is optional if you've already defined
the primary key column in this model. |
|
reportError ( string $message, array $extra = [] ) : LazyRecord\Result\OperationError |
Report error. |
|
reportSuccess ( string $message, array $extra = [] ) : Result |
Report success. |
|
save ( ) : Result |
Save current data (create or update)
if primary key is defined, do update
if primary key is not defined, do create. |
|
select ( $sels ) |
|
|
serialize ( ) |
=============================== |
|
set ( $name, $value ) |
|
|
setAlias ( $alias ) |
|
|
setCurrentUser ( CurrentUserInterface $user ) |
|
|
setData ( array $array ) |
Set raw data. |
|
setInternalCache ( string $key, mixed $val ) : mixed |
set internal cache, in php memory. |
|
setPreferredTable ( $tableName ) |
|
|
setStashedData ( array $array ) |
|
|
toArray ( array $fields = null ) : array |
return data stash array,. |
|
toInflatedArray ( ) : array |
Deflate data and return. |
|
toJson ( ) : string |
return json format data. |
|
toXml ( ) : string |
Return xml format data. |
|
toYaml ( ) : string |
Return YAML format data. |
|
unlock ( ) |
|
|
unserialize ( $data ) |
|
|
unsetPrimaryKey ( ) |
|
|
update ( array $args, $options = [] ) : Result |
Update current record. |
|
using ( string $dsId ) |
Use specific data source for data operations. |
|