PHP Class Bolt\Storage\Repository\BaseLogRepository

Inheritance: extends Bolt\Storage\Repository
Show file Open project: bolt/bolt

Public Methods

Method Description
clearLog ( ) : boolean Clear the log table.
createQueryBuilder ( $alias = null ) : Doctrine\DBAL\Query\QueryBuilder Creates a query builder instance namespaced to this repository
getActivity ( integer $page = 1, integer $amount = 10, array $options = [] ) : Bolt\Storage\Entity\LogChange[] Get content log's activity entries.
getActivityCount ( array $options = [] ) : integer | false Get the total amount of log entries, optionally limited to a given level and/or context.
getActivityCountQuery ( array $options ) : Doctrine\DBAL\Query\QueryBuilder Build the query for the entry count.
getActivityQuery ( integer $page, integer $amount, array $options ) : Doctrine\DBAL\Query\QueryBuilder Build the query to get the log entries.
queryTrimLog ( DateTime $period ) : Doctrine\DBAL\Query\QueryBuilder Build the query for a log trim.
trimLog ( DateTime $period ) : boolean Trim logs older that provided date.

Protected Methods

Method Description
addWhereActivity ( Doctrine\DBAL\Query\QueryBuilder $qb, array $options ) Add required WHERE parameters.
buildWhereOr ( Doctrine\DBAL\Query\QueryBuilder $qb, string $parentColumnName, array $options ) : CompositeExpression Build an OR group that is added to the AND.
getCount ( array | false $result ) : integer | false Get a column count query result.

Method Details

addWhereActivity() protected method

Add required WHERE parameters.
protected addWhereActivity ( Doctrine\DBAL\Query\QueryBuilder $qb, array $options )
$qb Doctrine\DBAL\Query\QueryBuilder
$options array

buildWhereOr() protected method

Build an OR group that is added to the AND.
protected buildWhereOr ( Doctrine\DBAL\Query\QueryBuilder $qb, string $parentColumnName, array $options ) : CompositeExpression
$qb Doctrine\DBAL\Query\QueryBuilder
$parentColumnName string
$options array
return Doctrine\DBAL\Query\Expression\CompositeExpression

clearLog() public method

Clear the log table.
public clearLog ( ) : boolean
return boolean

createQueryBuilder() public method

Creates a query builder instance namespaced to this repository
public createQueryBuilder ( $alias = null ) : Doctrine\DBAL\Query\QueryBuilder
return Doctrine\DBAL\Query\QueryBuilder

getActivity() public method

Get content log's activity entries.
public getActivity ( integer $page = 1, integer $amount = 10, array $options = [] ) : Bolt\Storage\Entity\LogChange[]
$page integer
$amount integer
$options array
return Bolt\Storage\Entity\LogChange[]

getActivityCount() public method

Get the total amount of log entries, optionally limited to a given level and/or context.
public getActivityCount ( array $options = [] ) : integer | false
$options array
return integer | false

getActivityCountQuery() public method

Build the query for the entry count.
public getActivityCountQuery ( array $options ) : Doctrine\DBAL\Query\QueryBuilder
$options array
return Doctrine\DBAL\Query\QueryBuilder

getActivityQuery() public method

Build the query to get the log entries.
public getActivityQuery ( integer $page, integer $amount, array $options ) : Doctrine\DBAL\Query\QueryBuilder
$page integer
$amount integer
$options array
return Doctrine\DBAL\Query\QueryBuilder

getCount() protected method

Get a column count query result.
protected getCount ( array | false $result ) : integer | false
$result array | false
return integer | false

queryTrimLog() public method

Build the query for a log trim.
public queryTrimLog ( DateTime $period ) : Doctrine\DBAL\Query\QueryBuilder
$period DateTime
return Doctrine\DBAL\Query\QueryBuilder

trimLog() public method

Trim logs older that provided date.
public trimLog ( DateTime $period ) : boolean
$period DateTime
return boolean