SlaxWeb Framework
 All Classes Namespaces Functions Variables Pages
Public Member Functions | Protected Attributes | List of all members
SlaxWeb\Cache\Database\Model Class Reference
Inheritance diagram for SlaxWeb\Cache\Database\Model:
Inheritance graph
[legend]
Collaboration diagram for SlaxWeb\Cache\Database\Model:
Collaboration graph
[legend]

Public Member Functions

 setCache (CacheManager $cache)
 
 skipCache ()
 
 setCacheName (string $name)
 
 select (array $columns)
 
 update (array $columns)
 
- Public Member Functions inherited from SlaxWeb\Database\BaseModel
 __construct (Logger $logger, Config $config, Inflector $inflector, Builder $queryBuilder, Database $db, HooksContainer $hooks)
 
 getPrimKey ()
 
 create (array $data)
 
 select (array $columns)
 
 update (array $columns)
 
 delete ()
 
 where (string $column, $value, string $opr="=")
 
 orWhere (string $column, $value, string $opr="=")
 
 groupWhere (\Closure $predicates)
 
 orGroupWhere (\Closure $predicates)
 
 nestedWhere (string $column,\Closure $nested, string $lOpr="IN")
 
 orNestedWhere (string $column,\Closure $nested, string $lOpr="IN")
 
 join (string $table, string $type="INNER JOIN")
 
 joinModel (BaseModel $model, string $forKey, string $type="INNER JOIN", string $cOpr="=")
 
 joinCond (string $primKey, string $forKey, string $cOpr="=")
 
 orJoinCond (string $primKey, string $forKey, string $cOpr="=")
 
 joinCols (array $cols)
 
 groupBy (string $col)
 
 orderBy (string $col, string $direction="ASC", string $func="")
 
 limit (int $limit, int $offset=0)
 
 lastError ()
 

Protected Attributes

 $cache = null
 
 $cacheName = ""
 
 $skipCache = true
 
- Protected Attributes inherited from SlaxWeb\Database\BaseModel
 $primKey = ""
 
 $logger = null
 
 $config = null
 
 $inflector = null
 
 $qBuilder = null
 
 $db = null
 
 $error = null
 
 $softDelete = false
 
 $delCol = ""
 
 $delValType = 0
 
 $timestamps = null
 
 $createdColumn = ""
 
 $updatedColumn = ""
 
 $timestampFunction = ""
 
 $hooks = null
 
 $hookName = null
 

Additional Inherited Members

- Public Attributes inherited from SlaxWeb\Database\BaseModel
const TBL_NAME_CAMEL_UCFIRST = 1
 
const TBL_NAME_CAMEL_LCFIRST = 2
 
const TBL_NAME_UNDERSCORE = 3
 
const TBL_NAME_UPPERCASE = 4
 
const TBL_NAME_LOWERCASE = 5
 
const HOOK_BEFORE = "before"
 
const HOOK_AFTER = "after"
 
const JOIN_INNER = "INNER JOIN"
 
const JOIN_LEFT = "LEFT OUTER JOIN"
 
const JOIN_RIGHT = "RIGHT OUTER JOIN"
 
const JOIN_FULL = "FULL OUTER JOIN"
 
const JOIN_CROSS = "CROSS JOIN"
 
const SDEL_VAL_BOOL = 1
 
const SDEL_VAL_TIMESTAMP = 2
 
 $table = ""
 
- Protected Member Functions inherited from SlaxWeb\Database\BaseModel
 invokeHook (string $modelMethod, string $before=self::HOOK_BEFORE)
 
 getClassName ()
 
 setTable ()
 
 setSoftDelete ()
 
 setTimestampConfig ()
 

Member Function Documentation

SlaxWeb\Cache\Database\Model::select ( array  $columns)

Checks if the cache contains a record for the desired query, and returns the cached result object.

SlaxWeb\Cache\Database\Model::setCache ( CacheManager  $cache)

Set Cache

Sets the Cache Manager to the model that is used later to obtain and store data from and to cache.

Parameters
\SlaxWeb\Cache\Manager$cacheCache Manager object
Returns
self
SlaxWeb\Cache\Database\Model::setCacheName ( string  $name)

Set Cache Name

Sets the cache name that will be included to the default cache name when writting to cache. If the cache name is set, the 'update' method will automatically remove this models cache for that name.

Parameters
string$nameCache name
Returns
self
SlaxWeb\Cache\Database\Model::skipCache ( )

Skip cache

The next call to retrieve data will ignore cache, nor will it store the retrieved data to cache.

Returns
self
SlaxWeb\Cache\Database\Model::update ( array  $columns)

If the 'cacheName' property is set, then the cached data that contanis that name will be removed.


The documentation for this class was generated from the following file: