Comments
extends Gateway
in package
implements
DbServiceAwareInterface
Uses
DbServiceAwareTrait
Table Definition for comments
Tags
Interfaces, Classes, Traits and Enums
- DbServiceAwareInterface
- Marker interface for classes that depend on the \VuFind\Db\Service\PluginManager
Table of Contents
- $dbServiceManager : PluginManager
- Database service plugin manager
- $tableManager : PluginManager
- Table manager
- __construct() : mixed
- Constructor
- beginTransaction() : void
- Begin a database transaction.
- commitTransaction() : void
- Commit a database transaction.
- createRow() : object
- Create a new row.
- deleteByUser() : void
- Deletes all comments by a user.
- deleteIfOwnedByUser() : bool
- Delete a comment if the owner is logged in. Returns true on success.
- getDbService() : T
- Get a database service object.
- getDbServiceManager() : PluginManager
- Get the service plugin manager. Throw an exception if it is missing.
- getDbTable() : Gateway
- Get access to another table.
- getForResource() : array<string|int, mixed>|AbstractResultSet
- Get tags associated with the specified resource.
- getStatistics() : array<string|int, mixed>
- Get statistics on use of comments.
- initializeFeatures() : void
- Initialize features
- rollBackTransaction() : void
- Roll back a database transaction.
- setDbServiceManager() : void
- Set the service plugin manager.
Properties
$dbServiceManager
Database service plugin manager
protected
PluginManager
$dbServiceManager
$tableManager
Table manager
protected
PluginManager
$tableManager
Methods
__construct()
Constructor
public
__construct(Adapter $adapter, PluginManager $tm, array<string|int, mixed> $cfg[, RowGateway $rowObj = null ][, string $table = 'comments' ]) : mixed
Parameters
- $adapter : Adapter
-
Database adapter
- $tm : PluginManager
-
Table manager
- $cfg : array<string|int, mixed>
-
Laminas configuration
- $rowObj : RowGateway = null
-
Row prototype object (null for default)
- $table : string = 'comments'
-
Name of database table to interface with
Return values
mixed —beginTransaction()
Begin a database transaction.
public
beginTransaction() : void
Tags
Return values
void —commitTransaction()
Commit a database transaction.
public
commitTransaction() : void
Tags
Return values
void —createRow()
Create a new row.
public
createRow() : object
Return values
object —deleteByUser()
Deletes all comments by a user.
public
deleteByUser(User $user) : void
Parameters
- $user : User
-
User object
Return values
void —deleteIfOwnedByUser()
Delete a comment if the owner is logged in. Returns true on success.
public
deleteIfOwnedByUser(int $id, UserEntityInterface $user) : bool
Parameters
- $id : int
-
ID of row to delete
- $user : UserEntityInterface
-
Logged in user object
Return values
bool —getDbService()
Get a database service object.
public
getDbService(class-string<\VuFind\Db\Service\T> $name) : T
Parameters
- $name : class-string<\VuFind\Db\Service\T>
-
Name of service to retrieve
Tags
Return values
T —getDbServiceManager()
Get the service plugin manager. Throw an exception if it is missing.
public
getDbServiceManager() : PluginManager
Tags
Return values
PluginManager —getDbTable()
Get access to another table.
public
getDbTable(string $table) : Gateway
Parameters
- $table : string
-
Table name
Return values
Gateway —getForResource()
Get tags associated with the specified resource.
public
getForResource(string $id[, string $source = DEFAULT_SEARCH_BACKEND ]) : array<string|int, mixed>|AbstractResultSet
Parameters
- $id : string
-
Record ID to look up
- $source : string = DEFAULT_SEARCH_BACKEND
-
Source of record to look up
Return values
array<string|int, mixed>|AbstractResultSet —getStatistics()
Get statistics on use of comments.
public
getStatistics() : array<string|int, mixed>
Return values
array<string|int, mixed> —initializeFeatures()
Initialize features
public
initializeFeatures(array<string|int, mixed> $cfg) : void
Parameters
- $cfg : array<string|int, mixed>
-
Laminas configuration
Return values
void —rollBackTransaction()
Roll back a database transaction.
public
rollBackTransaction() : void
Tags
Return values
void —setDbServiceManager()
Set the service plugin manager.
public
setDbServiceManager(PluginManager $manager) : void
Parameters
- $manager : PluginManager
-
Plugin manager