VuFind API Documentation

Resource extends RowGateway
in package
implements DbServiceAwareInterface, DbTableAwareInterface, ResourceEntityInterface Uses DbServiceAwareTrait, DbTableAwareTrait

Row Definition for resource

Tags
category

VuFind

author

Demian Katz demian.katz@villanova.edu

license

http://opensource.org/licenses/gpl-2.0.php GNU General Public License

link

Main Site

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

$extra_metadata

public string|null $extra_metadata

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
throws
LoginRequired
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
throws
LoginRequired
throws
Exception
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
deprecated

Use \VuFind\Tags\TagService::linkTagToResource()

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
deprecated

Use \VuFind\Record\ResourcePopulator::assignMetadata()

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
deprecated

Use \VuFind\Tags\TagsService::unlinkTagFromResource()

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
deprecated

Use ResourceTagsServiceInterface::destroyResourceTagsLinksForUser()

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
template

T

Return values
T

getDbTable()

Get a database table object.

public getDbTable(string $table) : Gateway
Parameters
$table : string

Table to load.

Return values
Gateway

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

Search results