Resource
extends RowGateway
in package
implements
DbServiceAwareInterface, DbTableAwareInterface, ResourceEntityInterface
Uses
DbServiceAwareTrait, DbTableAwareTrait
Row Definition for resource
Tags
Interfaces, Classes, Traits and Enums
- DbServiceAwareInterface
- Marker interface for classes that depend on the \VuFind\Db\Service\PluginManager
- DbTableAwareInterface
- Marker interface for classes that depend on the \VuFind\Db\Table\PluginManager
- ResourceEntityInterface
- Entity model interface for resource table
Table of Contents
- $author : string|null
- $extra_metadata : string|null
- $id : int
- $record_id : string
- $source : string
- $title : string
- $year : int|null
- $dbServiceManager : PluginManager
- Database service plugin manager
- $tableManager : PluginManager
- Database table plugin manager
- __construct() : mixed
- Constructor
- addComment() : int
- Add a comment to the current resource.
- addOrUpdateRating() : int
- Add or update user's rating for the current resource.
- addTag() : void
- Add a tag to the current resource.
- assignMetadata() : Resource
- Use a record driver to assign metadata to the current row. Return the current object to allow fluent interface.
- deleteTag() : void
- Remove a tag from the current resource.
- deleteTags() : void
- Remove tags from the current resource.
- getDbService() : T
- Get a database service object.
- getDbServiceManager() : PluginManager
- Get the service plugin manager. Throw an exception if it is missing.
- getDbTable() : Gateway
- Get a database table object.
- getDbTableManager() : PluginManager
- Get the table plugin manager. Throw an exception if it is missing.
- getExtraMetadata() : string|null
- Extra Metadata getter
- getId() : int
- Id getter
- getPrimaryKeyColumn() : array<string|int, mixed>
- Retrieve primary key information.
- getRecordId() : string
- Record Id getter
- getSource() : string
- Source getter
- getTitle() : string
- Title getter
- setAuthor() : ResourceEntityInterface
- Author setter
- setDbServiceManager() : void
- Set the service plugin manager.
- setDbTableManager() : void
- Set the table plugin manager.
- setExtraMetadata() : ResourceEntityInterface
- Extra Metadata setter
- setRecordId() : ResourceEntityInterface
- Record Id setter
- setSource() : ResourceEntityInterface
- Source setter
- setTitle() : ResourceEntityInterface
- Title setter
- setYear() : ResourceEntityInterface
- Year setter
Properties
$author
public
string|null
$author
$extra_metadata
public
string|null
$extra_metadata
$id
public
int
$id
$record_id
public
string
$record_id
$source
public
string
$source
$title
public
string
$title
$year
public
int|null
$year
$dbServiceManager
Database service plugin manager
protected
PluginManager
$dbServiceManager
$tableManager
Database table plugin manager
protected
PluginManager
$tableManager
Methods
__construct()
Constructor
public
__construct(Adapter $adapter) : mixed
Parameters
- $adapter : Adapter
-
Database adapter
Return values
mixed —addComment()
Add a comment to the current resource.
public
addComment(string $comment, User $user) : int
Parameters
- $comment : string
-
The comment to save.
- $user : User
-
The user posting the comment.
Tags
Return values
int —ID of newly-created comment.
addOrUpdateRating()
Add or update user's rating for the current resource.
public
addOrUpdateRating(int $userId, int|null $rating) : int
Parameters
- $userId : int
-
User ID
- $rating : int|null
-
Rating (null to delete)
Tags
Return values
int —ID of rating added, deleted or updated
addTag()
Add a tag to the current resource.
public
addTag(string $tagText, UserEntityInterface $user[, string $list_id = null ]) : void
Parameters
- $tagText : string
-
The tag to save.
- $user : UserEntityInterface
-
The user posting the tag.
- $list_id : string = null
-
The list associated with the tag (optional).
Tags
Return values
void —assignMetadata()
Use a record driver to assign metadata to the current row. Return the current object to allow fluent interface.
public
assignMetadata(AbstractBase $driver, Converter $converter) : Resource
Parameters
- $driver : AbstractBase
-
The record driver
- $converter : Converter
-
Date converter
Tags
Return values
Resource —deleteTag()
Remove a tag from the current resource.
public
deleteTag(string $tagText, User $user[, string $list_id = null ]) : void
Parameters
- $tagText : string
-
The tag to delete.
- $user : User
-
The user deleting the tag.
- $list_id : string = null
-
The list associated with the tag (optional).
Tags
Return values
void —deleteTags()
Remove tags from the current resource.
public
deleteTags(User $user[, string $list_id = null ]) : void
Parameters
- $user : User
-
The user deleting the tags.
- $list_id : string = null
-
The list associated with the tags (optional -- omitting this will delete ALL of the user's tags).
Tags
Return values
void —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 a database table object.
public
getDbTable(string $table) : Gateway
Parameters
- $table : string
-
Table to load.
Return values
Gateway —getDbTableManager()
Get the table plugin manager. Throw an exception if it is missing.
public
getDbTableManager() : PluginManager
Tags
Return values
PluginManager —getExtraMetadata()
Extra Metadata getter
public
getExtraMetadata() : string|null
Return values
string|null —getId()
Id getter
public
getId() : int
Return values
int —getPrimaryKeyColumn()
Retrieve primary key information.
public
getPrimaryKeyColumn() : array<string|int, mixed>
Return values
array<string|int, mixed> —getRecordId()
Record Id getter
public
getRecordId() : string
Return values
string —getSource()
Source getter
public
getSource() : string
Return values
string —getTitle()
Title getter
public
getTitle() : string
Return values
string —setAuthor()
Author setter
public
setAuthor(string|null $author) : ResourceEntityInterface
Parameters
- $author : string|null
-
Author of the title.
Return values
ResourceEntityInterface —setDbServiceManager()
Set the service plugin manager.
public
setDbServiceManager(PluginManager $manager) : void
Parameters
- $manager : PluginManager
-
Plugin manager
Return values
void —setDbTableManager()
Set the table plugin manager.
public
setDbTableManager(PluginManager $manager) : void
Parameters
- $manager : PluginManager
-
Plugin manager
Return values
void —setExtraMetadata()
Extra Metadata setter
public
setExtraMetadata(string|null $extraMetadata) : ResourceEntityInterface
Parameters
- $extraMetadata : string|null
-
ExtraMetadata.
Return values
ResourceEntityInterface —setRecordId()
Record Id setter
public
setRecordId(string $recordId) : ResourceEntityInterface
Parameters
- $recordId : string
-
recordId
Return values
ResourceEntityInterface —setSource()
Source setter
public
setSource(string $source) : ResourceEntityInterface
Parameters
- $source : string
-
Source (a search backend ID).
Return values
ResourceEntityInterface —setTitle()
Title setter
public
setTitle(string $title) : ResourceEntityInterface
Parameters
- $title : string
-
Title of the record.
Return values
ResourceEntityInterface —setYear()
Year setter
public
setYear(int|null $year) : ResourceEntityInterface
Parameters
- $year : int|null
-
Year title is published.