diff --git a/module/VuFind/src/VuFind/Db/Entity/AccessToken.php b/module/VuFind/src/VuFind/Db/Entity/AccessToken.php index 4836e666373..e9f87635c8c 100644 --- a/module/VuFind/src/VuFind/Db/Entity/AccessToken.php +++ b/module/VuFind/src/VuFind/Db/Entity/AccessToken.php @@ -44,41 +44,64 @@ class AccessToken implements EntityInterface { /** + * Unique ID. + * * @var string * - * @ORM\Column(name="id", type="string", length=255, nullable=false) + * @ORM\Column(name="id", + * type="string", + * length=255, + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="NONE") */ protected $id; /** + * Token type. + * * @var string * - * @ORM\Column(name="type", type="string", length=128, nullable=false) + * @ORM\Column(name="type", + * type="string", + * length=128, + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="NONE") */ protected $type; /** + * User ID. + * * @var \VuFind\Db\Entity\User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id") * }) */ protected $user; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; /** + * Data. + * * @var string|null * * @ORM\Column(name="data", type="text", length=16777215, nullable=true) @@ -86,6 +109,8 @@ class AccessToken implements EntityInterface protected $data; /** + * Flag indicating status of the token. + * * @var bool * * @ORM\Column(name="revoked", type="boolean", nullable=false) diff --git a/module/VuFind/src/VuFind/Db/Entity/AuthHash.php b/module/VuFind/src/VuFind/Db/Entity/AuthHash.php index 74cd9514fc9..23963fe7496 100644 --- a/module/VuFind/src/VuFind/Db/Entity/AuthHash.php +++ b/module/VuFind/src/VuFind/Db/Entity/AuthHash.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,34 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="auth_hash", uniqueConstraints={@ORM\UniqueConstraint(name="hash_type", columns={"hash", "type"})}, indexes={@ORM\Index(name="created", columns={"created"}), @ORM\Index(name="session_id", columns={"session_id"})}) + * @ORM\Table(name="auth_hash", + * uniqueConstraints={@ORM\UniqueConstraint(name="hash_type", + * columns={"hash", "type"})}, + * indexes={@ORM\Index(name="created", columns={"created"}), + * @ORM\Index(name="session_id", columns={"session_id"})} + * ) * @ORM\Entity */ class AuthHash implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="bigint", nullable=false, options={"unsigned"=true}) * @ORM\Id + * @ORM\Column(name="id", + * type="bigint", + * nullable=false, + * options={"unsigned"=true} + * ) * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Session ID. + * * @var string|null * * @ORM\Column(name="session_id", type="string", length=128, nullable=true) @@ -60,6 +73,8 @@ class AuthHash implements EntityInterface protected $sessionId; /** + * Hash value. + * * @var string * * @ORM\Column(name="hash", type="string", length=255, nullable=false) @@ -67,6 +82,8 @@ class AuthHash implements EntityInterface protected $hash = ''; /** + * Type of the hash. + * * @var string|null * * @ORM\Column(name="type", type="string", length=50, nullable=true) @@ -74,6 +91,8 @@ class AuthHash implements EntityInterface protected $type; /** + * Data. + * * @var string|null * * @ORM\Column(name="data", type="text", length=16777215, nullable=true) @@ -81,9 +100,15 @@ class AuthHash implements EntityInterface protected $data; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="CURRENT_TIMESTAMP"} + * ) */ protected $created = 'CURRENT_TIMESTAMP'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php b/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php index 9cf96098501..c8e609840b4 100644 --- a/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php +++ b/module/VuFind/src/VuFind/Db/Entity/ChangeTracker.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,30 +38,44 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="change_tracker", indexes={@ORM\Index(name="deleted_index", columns={"deleted"})}) + * @ORM\Table(name="change_tracker", + * indexes={@ORM\Index(name="deleted_index", columns={"deleted"})} + * ) * @ORM\Entity */ class ChangeTracker implements EntityInterface { /** + * Solr core containing record. + * * @var string * - * @ORM\Column(name="core", type="string", length=30, nullable=false) + * @ORM\Column(name="core", + * type="string", + * length=30, + * nullable=false + * ) * @ORM\Id - * @ORM\GeneratedValue(strategy="NONE") */ protected $core; /** + * Id of record within core. + * * @var string * - * @ORM\Column(name="id", type="string", length=120, nullable=false) + * @ORM\Column(name="id", + * type="string", + * length=120, + * nullable=false + * ) * @ORM\Id - * @ORM\GeneratedValue(strategy="NONE") */ protected $id; /** + * First time added to index + * * @var \DateTime|null * * @ORM\Column(name="first_indexed", type="datetime", nullable=true) @@ -69,6 +83,8 @@ class ChangeTracker implements EntityInterface protected $firstIndexed; /** + * Last time changed in index. + * * @var \DateTime|null * * @ORM\Column(name="last_indexed", type="datetime", nullable=true) @@ -76,6 +92,8 @@ class ChangeTracker implements EntityInterface protected $lastIndexed; /** + * Last time original record was edited. + * * @var \DateTime|null * * @ORM\Column(name="last_record_change", type="datetime", nullable=true) @@ -83,6 +101,8 @@ class ChangeTracker implements EntityInterface protected $lastRecordChange; /** + * Time record was removed from index. + * * @var \DateTime|null * * @ORM\Column(name="deleted", type="datetime", nullable=true) diff --git a/module/VuFind/src/VuFind/Db/Entity/Comments.php b/module/VuFind/src/VuFind/Db/Entity/Comments.php index aa95f53f3ee..e132cb17d89 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Comments.php +++ b/module/VuFind/src/VuFind/Db/Entity/Comments.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,28 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="comments", indexes={@ORM\Index(name="resource_id", columns={"resource_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) + * @ORM\Table(name="comments") * @ORM\Entity */ class Comments implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Comment. + * * @var string * * @ORM\Column(name="comment", type="text", length=65535, nullable=false) @@ -60,28 +67,40 @@ class Comments implements EntityInterface protected $comment; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; /** + * User ID. + * * @var \VuFind\Db\Entity\User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id") * }) */ protected $user; /** + * Resource ID. + * * @var \VuFind\Db\Entity\Resource * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\Resource") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="resource_id", referencedColumnName="id") + * @ORM\JoinColumn(name="resource_id", + * referencedColumnName="id") * }) */ protected $resource; diff --git a/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php b/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php index 6b99d74ae13..82c81eac506 100644 --- a/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php +++ b/module/VuFind/src/VuFind/Db/Entity/ExternalSession.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,33 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="external_session", uniqueConstraints={@ORM\UniqueConstraint(name="session_id", columns={"session_id"})}, indexes={@ORM\Index(name="external_session_id", columns={"external_session_id"})}) + * @ORM\Table(name="external_session", + * uniqueConstraints={@ORM\UniqueConstraint(name="session_id", + * columns={"session_id"})}, + * indexes={@ORM\Index(name="external_session_id", columns={"external_session_id"})} + * ) * @ORM\Entity */ class ExternalSession implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="bigint", nullable=false, options={"unsigned"=true}) + * @ORM\Column(name="id", + * type="bigint", + * nullable=false, + * options={"unsigned"=true} + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Session ID. + * * @var string * * @ORM\Column(name="session_id", type="string", length=128, nullable=false) @@ -60,16 +72,28 @@ class ExternalSession implements EntityInterface protected $sessionId; /** + * External session ID. + * * @var string * - * @ORM\Column(name="external_session_id", type="string", length=255, nullable=false) + * @ORM\Column(name="external_session_id", + * type="string", + * length=255, + * nullable=false + * ) */ protected $externalSessionId; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Feedback.php b/module/VuFind/src/VuFind/Db/Entity/Feedback.php index 8def36a065c..ede7fb06b42 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Feedback.php +++ b/module/VuFind/src/VuFind/Db/Entity/Feedback.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2022. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -29,7 +29,6 @@ use DateTime; use Doctrine\ORM\Mapping as ORM; -use VuFind\Db\Entity\User; /** * Entity model for feedback table @@ -40,7 +39,11 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="feedback", indexes={@ORM\Index(name="user_id", columns={"user_id"}), @ORM\Index(name="created", columns={"created"}), @ORM\Index(name="status", columns={"status"}), @ORM\Index(name="form_name", columns={"form_name"})}) + * @ORM\Table(name="feedback", + * indexes={@ORM\Index(name="created", columns={"created"}), + * @ORM\Index(name="status", columns={"status"}), + * @ORM\Index(name="form_name", columns={"form_name"})} + * ) * @ORM\Entity */ class Feedback implements EntityInterface @@ -50,7 +53,11 @@ class Feedback implements EntityInterface * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false, options={"unsigned"=true}) + * @ORM\Column(name="id", + * type="integer", + * nullable=false, + * options={"unsigned"=true} + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ @@ -61,7 +68,11 @@ class Feedback implements EntityInterface * * @var string * - * @ORM\Column(name="message", type="text", length=0, nullable=false) + * @ORM\Column(name="message", + * type="text", + * length=0, + * nullable=false + * ) */ protected $message; @@ -70,7 +81,11 @@ class Feedback implements EntityInterface * * @var string * - * @ORM\Column(name="form_data", type="json", length=0, nullable=true) + * @ORM\Column(name="form_data", + * type="json", + * length=0, + * nullable=true + * ) */ protected $formData; @@ -79,7 +94,11 @@ class Feedback implements EntityInterface * * @var string * - * @ORM\Column(name="form_name", type="string", length=255, nullable=false) + * @ORM\Column(name="form_name", + * type="string", + * length=255, + * nullable=false + * ) */ protected $formName; @@ -88,7 +107,11 @@ class Feedback implements EntityInterface * * @var DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="CURRENT_TIMESTAMP"} + * ) */ protected $created = 'CURRENT_TIMESTAMP'; @@ -97,7 +120,11 @@ class Feedback implements EntityInterface * * @var DateTime * - * @ORM\Column(name="updated", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + * @ORM\Column(name="updated", + * type="datetime", + * nullable=false, + * options={"default"="CURRENT_TIMESTAMP"} + * ) */ protected $updated = 'CURRENT_TIMESTAMP'; @@ -106,7 +133,12 @@ class Feedback implements EntityInterface * * @var string * - * @ORM\Column(name="status", type="string", length=255, nullable=false, options={"default"="open"}) + * @ORM\Column(name="status", + * type="string", + * length=255, + * nullable=false, + * options={"default"="open"} + * ) */ protected $status = 'open'; @@ -115,7 +147,11 @@ class Feedback implements EntityInterface * * @var string * - * @ORM\Column(name="site_url", type="string", length=255, nullable=false) + * @ORM\Column(name="site_url", + * type="string", + * length=255, + * nullable=false + * ) */ protected $siteUrl; @@ -126,7 +162,8 @@ class Feedback implements EntityInterface * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id") * }) */ protected $user; @@ -138,59 +175,123 @@ class Feedback implements EntityInterface * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="updated_by", referencedColumnName="id") + * @ORM\JoinColumn(name="updated_by", + * referencedColumnName="id") * }) */ protected $updatedBy; + /** + * Message setter + * + * @param string $message Message + * + * @return Feedback + */ public function setMessage(string $message): Feedback { $this->message = $message; return $this; } + /** + * Form data setter. + * + * @param string $data Form data + * + * @return Feedback + */ public function setFormData(string $data): Feedback { $this->formData = $data; return $this; } + /** + * Form name setter. + * + * @param string $name Form name + * + * @return Feedback + */ public function setFormName(string $name): Feedback { $this->formName = $name; return $this; } + /** + * Created setter. + * + * @param Datetime $dateTime Created date + * + * @return Feedback + */ public function setCreated(DateTime $dateTime): Feedback { $this->created = $dateTime; return $this; } + /** + * Updated setter. + * + * @param Datetime $dateTime Last update date + * + * @return Feedback + */ public function setUpdated(DateTime $dateTime): Feedback { $this->updated = $dateTime; return $this; } + /** + * Status setter. + * + * @param string $status Status + * + * @return Feedback + */ public function setStatus(string $status): Feedback { $this->status = $status; return $this; } + /** + * Site URL setter. + * + * @param string $url Site URL + * + * @return Feedback + */ public function setSiteUrl(string $url): Feedback { $this->siteUrl = $url; return $this; } + /** + * User setter. + * + * @param User $user User that created request + * + * @return Feedback + */ public function setUser(?User $user): Feedback { $this->user = $user; return $this; } + /** + * Updatedby setter. + * + * @param User $user User that updated request + * + * @return Feedback + */ public function setUpdatedBy(?User $user): Feedback { $this->updatedBy = $user; diff --git a/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php b/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php index 9a09f04ddfa..67a52d0f047 100644 --- a/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php +++ b/module/VuFind/src/VuFind/Db/Entity/OaiResumption.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -44,15 +44,22 @@ class OaiResumption implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Resumption parameters. + * * @var string|null * * @ORM\Column(name="params", type="text", length=65535, nullable=true) @@ -60,9 +67,15 @@ class OaiResumption implements EntityInterface protected $params; /** + * Expiry date. + * * @var \DateTime * - * @ORM\Column(name="expires", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="expires", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $expires = '2000-01-01 00:00:00'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Ratings.php b/module/VuFind/src/VuFind/Db/Entity/Ratings.php index 6abcb0ba3dc..248b1191c36 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Ratings.php +++ b/module/VuFind/src/VuFind/Db/Entity/Ratings.php @@ -44,35 +44,48 @@ class Ratings implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * User ID. + * * @var \VuFind\Db\Entity\User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id") * }) */ protected $user; /** + * Resource ID. + * * @var \VuFind\Db\Entity\Resource * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\Resource") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="resource_id", referencedColumnName="id") + * @ORM\JoinColumn(name="resource_id", + * referencedColumnName="id") * }) */ protected $resource; /** + * Rating. + * * @var int * * @ORM\Column(name="rating", type="integer", nullable=false) @@ -80,9 +93,15 @@ class Ratings implements EntityInterface protected $rating; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Record.php b/module/VuFind/src/VuFind/Db/Entity/Record.php index 2564ffa480b..514aa605bab 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Record.php +++ b/module/VuFind/src/VuFind/Db/Entity/Record.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,30 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="record", uniqueConstraints={@ORM\UniqueConstraint(name="record_id_source", columns={"record_id", "source"})}) + * @ORM\Table(name="record", + * uniqueConstraints={@ORM\UniqueConstraint(name="record_id_source", + * columns={"record_id", "source"})}) * @ORM\Entity */ class Record implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Record ID. + * * @var string|null * * @ORM\Column(name="record_id", type="string", length=255, nullable=true) @@ -60,6 +69,8 @@ class Record implements EntityInterface protected $recordId; /** + * Record source. + * * @var string|null * * @ORM\Column(name="source", type="string", length=50, nullable=true) @@ -67,6 +78,8 @@ class Record implements EntityInterface protected $source; /** + * Record version. + * * @var string * * @ORM\Column(name="version", type="string", length=20, nullable=false) @@ -74,6 +87,8 @@ class Record implements EntityInterface protected $version; /** + * Record Data. + * * @var string|null * * @ORM\Column(name="data", type="text", length=0, nullable=true) @@ -81,9 +96,15 @@ class Record implements EntityInterface protected $data; /** + * Updated date. + * * @var \DateTime * - * @ORM\Column(name="updated", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="updated", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $updated = '2000-01-01 00:00:00'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Resource.php b/module/VuFind/src/VuFind/Db/Entity/Resource.php index 02fbca96fcf..4299890257a 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Resource.php +++ b/module/VuFind/src/VuFind/Db/Entity/Resource.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,30 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="resource", indexes={@ORM\Index(name="record_id", columns={"record_id"})}) + * @ORM\Table(name="resource", + * indexes={@ORM\Index(name="record_id", columns={"record_id"})} + * ) * @ORM\Entity */ class Resource implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Record ID. + * * @var string * * @ORM\Column(name="record_id", type="string", length=255, nullable=false) @@ -60,6 +69,8 @@ class Resource implements EntityInterface protected $recordId = ''; /** + * Record title. + * * @var string * * @ORM\Column(name="title", type="string", length=255, nullable=false) @@ -67,6 +78,8 @@ class Resource implements EntityInterface protected $title = ''; /** + * Primary author. + * * @var string|null * * @ORM\Column(name="author", type="string", length=255, nullable=true) @@ -74,6 +87,8 @@ class Resource implements EntityInterface protected $author; /** + * Published year. + * * @var int|null * * @ORM\Column(name="year", type="integer", nullable=true) @@ -81,16 +96,29 @@ class Resource implements EntityInterface protected $year; /** + * Record source. + * * @var string * - * @ORM\Column(name="source", type="string", length=50, nullable=false, options={"default"="Solr"}) + * @ORM\Column(name="source", + * type="string", + * length=50, + * nullable=false, + * options={"default"="Solr"} + * ) */ protected $source = 'Solr'; /** + * Record Metadata + * * @var string|null * - * @ORM\Column(name="extra_metadata", type="text", length=16777215, nullable=true) + * @ORM\Column(name="extra_metadata", + * type="text", + * length=16777215, + * nullable=true + * ) */ protected $extraMetadata; } diff --git a/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php b/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php index 9baa1d37daa..964c34fed2e 100644 --- a/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php +++ b/module/VuFind/src/VuFind/Db/Entity/ResourceTags.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,63 +38,86 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="resource_tags", indexes={@ORM\Index(name="list_id", columns={"list_id"}), @ORM\Index(name="resource_id", columns={"resource_id"}), @ORM\Index(name="tag_id", columns={"tag_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) + * @ORM\Table(name="resource_tags") * @ORM\Entity */ class ResourceTags implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Posted time. + * * @var \DateTime * - * @ORM\Column(name="posted", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + * @ORM\Column(name="posted", + * type="datetime", + * nullable=false, + * options={"default"="CURRENT_TIMESTAMP"} + * ) */ protected $posted = 'CURRENT_TIMESTAMP'; /** + * Resource ID. + * * @var \VuFind\Db\Entity\Resource * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\Resource") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="resource_id", referencedColumnName="id") + * @ORM\JoinColumn(name="resource_id", + * referencedColumnName="id") * }) */ protected $resource; /** + * Tag ID. + * * @var \VuFind\Db\Entity\Tags * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\Tags") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="tag_id", referencedColumnName="id") + * @ORM\JoinColumn(name="tag_id", + * referencedColumnName="id") * }) */ protected $tag; /** + * List ID. + * * @var \VuFind\Db\Entity\UserList * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\UserList") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="list_id", referencedColumnName="id") + * @ORM\JoinColumn(name="list_id", + * referencedColumnName="id") * }) */ protected $list; /** + * User ID. + * * @var \VuFind\Db\Entity\User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id") * }) */ protected $user; diff --git a/module/VuFind/src/VuFind/Db/Entity/Search.php b/module/VuFind/src/VuFind/Db/Entity/Search.php index e03ccf745a5..f3780048b2d 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Search.php +++ b/module/VuFind/src/VuFind/Db/Entity/Search.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,34 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="search", indexes={@ORM\Index(name="folder_id", columns={"folder_id"}), @ORM\Index(name="notification_base_url", columns={"notification_base_url"}), @ORM\Index(name="notification_frequency", columns={"notification_frequency"}), @ORM\Index(name="session_id", columns={"session_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) + * @ORM\Table(name="search", + * indexes={@ORM\Index(name="folder_id", columns={"folder_id"}), + * @ORM\Index(name="notification_base_url", columns={"notification_base_url"}), + * @ORM\Index(name="notification_frequency", columns={"notification_frequency"}), + * @ORM\Index(name="session_id", columns={"session_id"}), + * @ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ class Search implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="bigint", nullable=false, options={"unsigned"=true}) + * @ORM\Column(name="id", + * type="bigint", + * nullable=false, + * options={"unsigned"=true} + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * User ID. + * * @var int * * @ORM\Column(name="user_id", type="integer", nullable=false) @@ -60,6 +73,8 @@ class Search implements EntityInterface protected $userId = '0'; /** + * Session ID. + * * @var string|null * * @ORM\Column(name="session_id", type="string", length=128, nullable=true) @@ -67,6 +82,8 @@ class Search implements EntityInterface protected $sessionId; /** + * Folder ID. + * * @var int|null * * @ORM\Column(name="folder_id", type="integer", nullable=true) @@ -74,13 +91,21 @@ class Search implements EntityInterface protected $folderId; /** + * Created date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; /** + * Title. + * * @var string|null * * @ORM\Column(name="title", type="string", length=20, nullable=true) @@ -88,6 +113,8 @@ class Search implements EntityInterface protected $title; /** + * Saved. + * * @var int * * @ORM\Column(name="saved", type="integer", nullable=false) @@ -95,6 +122,8 @@ class Search implements EntityInterface protected $saved = '0'; /** + * Search object. + * * @var string|null * * @ORM\Column(name="search_object", type="blob", length=65535, nullable=true) @@ -102,6 +131,8 @@ class Search implements EntityInterface protected $searchObject; /** + * Checksum + * * @var int|null * * @ORM\Column(name="checksum", type="integer", nullable=true) @@ -109,6 +140,8 @@ class Search implements EntityInterface protected $checksum; /** + * Notification frequency. + * * @var int * * @ORM\Column(name="notification_frequency", type="integer", nullable=false) @@ -116,16 +149,27 @@ class Search implements EntityInterface protected $notificationFrequency = '0'; /** + * Date last notification is sent. + * * @var \DateTime * - * @ORM\Column(name="last_notification_sent", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="last_notification_sent", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $lastNotificationSent = '2000-01-01 00:00:00'; /** + * Notification base URL. + * * @var string * - * @ORM\Column(name="notification_base_url", type="string", length=255, nullable=false) + * @ORM\Column(name="notification_base_url", + * type="string", + * length=255, nullable=false + * ) */ protected $notificationBaseUrl = ''; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Session.php b/module/VuFind/src/VuFind/Db/Entity/Session.php index 74bc8eaaec0..50f6824d597 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Session.php +++ b/module/VuFind/src/VuFind/Db/Entity/Session.php @@ -38,21 +38,32 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="session", uniqueConstraints={@ORM\UniqueConstraint(name="session_id", columns={"session_id"})}, indexes={@ORM\Index(name="last_used", columns={"last_used"})}) + * @ORM\Table(name="session", + * uniqueConstraints={@ORM\UniqueConstraint(name="session_id", + * columns={"session_id"})}, + * indexes={@ORM\Index(name="last_used", columns={"last_used"})}) * @ORM\Entity */ class Session implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="bigint", nullable=false, options={"unsigned"=true}) + * @ORM\Column(name="id", + * type="bigint", + * nullable=false, + * options={"unsigned"=true} + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Session ID. + * * @var string|null * * @ORM\Column(name="session_id", type="string", length=128, nullable=true) @@ -60,6 +71,8 @@ class Session implements EntityInterface protected $sessionId; /** + * Session data. + * * @var string|null * * @ORM\Column(name="data", type="text", length=16777215, nullable=true) @@ -67,6 +80,8 @@ class Session implements EntityInterface protected $data; /** + * Time session last used. + * * @var int * * @ORM\Column(name="last_used", type="integer", nullable=false) @@ -74,9 +89,15 @@ class Session implements EntityInterface protected $lastUsed = '0'; /** + * Time session is created. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php b/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php index ef4567f74f9..7c9ba91654b 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php +++ b/module/VuFind/src/VuFind/Db/Entity/Shortlinks.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,31 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="shortlinks", uniqueConstraints={@ORM\UniqueConstraint(name="shortlinks_hash_IDX", columns={"hash"})}) * @ORM\Entity + * @ORM\Table(name="shortlinks", + * uniqueConstraints={@ORM\UniqueConstraint(name="shortlinks_hash_IDX", + * columns={"hash"})} + * ) */ class Shortlinks implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Shortened URL. + * * @var string * * @ORM\Column(name="path", type="text", length=16777215, nullable=false) @@ -60,6 +70,8 @@ class Shortlinks implements EntityInterface protected $path; /** + * Shortlinks hash. + * * @var string|null * * @ORM\Column(name="hash", type="string", length=32, nullable=true) @@ -67,9 +79,15 @@ class Shortlinks implements EntityInterface protected $hash; /** + * Creation timestamp. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="CURRENT_TIMESTAMP"} + * ) */ protected $created = 'CURRENT_TIMESTAMP'; } diff --git a/module/VuFind/src/VuFind/Db/Entity/Tags.php b/module/VuFind/src/VuFind/Db/Entity/Tags.php index 780900a9b4a..2e86bb50dd3 100644 --- a/module/VuFind/src/VuFind/Db/Entity/Tags.php +++ b/module/VuFind/src/VuFind/Db/Entity/Tags.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -44,15 +44,22 @@ class Tags implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Name of tag. + * * @var string * * @ORM\Column(name="tag", type="string", length=64, nullable=false) diff --git a/module/VuFind/src/VuFind/Db/Entity/User.php b/module/VuFind/src/VuFind/Db/Entity/User.php index a8a73d90eea..5ce2d9e81b0 100644 --- a/module/VuFind/src/VuFind/Db/Entity/User.php +++ b/module/VuFind/src/VuFind/Db/Entity/User.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,31 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="user", uniqueConstraints={@ORM\UniqueConstraint(name="cat_id", columns={"cat_id"}), @ORM\UniqueConstraint(name="username", columns={"username"})}) + * @ORM\Table(name="user", + * uniqueConstraints={@ORM\UniqueConstraint(name="cat_id", + * columns={"cat_id"}), + * @ORM\UniqueConstraint(name="username", columns={"username"})}) * @ORM\Entity */ class User implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Username + * * @var string * * @ORM\Column(name="username", type="string", length=255, nullable=false) @@ -60,6 +70,8 @@ class User implements EntityInterface protected $username = ''; /** + * Password + * * @var string * * @ORM\Column(name="password", type="string", length=32, nullable=false) @@ -67,6 +79,8 @@ class User implements EntityInterface protected $password = ''; /** + * Hash of the password. + * * @var string|null * * @ORM\Column(name="pass_hash", type="string", length=60, nullable=true) @@ -74,6 +88,8 @@ class User implements EntityInterface protected $passHash; /** + * First Name. + * * @var string * * @ORM\Column(name="firstname", type="string", length=50, nullable=false) @@ -81,6 +97,8 @@ class User implements EntityInterface protected $firstname = ''; /** + * Last Name. + * * @var string * * @ORM\Column(name="lastname", type="string", length=50, nullable=false) @@ -88,6 +106,8 @@ class User implements EntityInterface protected $lastname = ''; /** + * Email. + * * @var string * * @ORM\Column(name="email", type="string", length=255, nullable=false) @@ -95,6 +115,8 @@ class User implements EntityInterface protected $email = ''; /** + * Date of email verification. + * * @var \DateTime|null * * @ORM\Column(name="email_verified", type="datetime", nullable=true) @@ -102,6 +124,8 @@ class User implements EntityInterface protected $emailVerified; /** + * Pending email. + * * @var string * * @ORM\Column(name="pending_email", type="string", length=255, nullable=false) @@ -109,6 +133,8 @@ class User implements EntityInterface protected $pendingEmail = ''; /** + * User provided email. + * * @var bool * * @ORM\Column(name="user_provided_email", type="boolean", nullable=false) @@ -116,6 +142,8 @@ class User implements EntityInterface protected $userProvidedEmail = '0'; /** + * Cat ID. + * * @var string|null * * @ORM\Column(name="cat_id", type="string", length=255, nullable=true) @@ -123,6 +151,8 @@ class User implements EntityInterface protected $catId; /** + * Cat username. + * * @var string|null * * @ORM\Column(name="cat_username", type="string", length=50, nullable=true) @@ -130,6 +160,8 @@ class User implements EntityInterface protected $catUsername; /** + * Cat password. + * * @var string|null * * @ORM\Column(name="cat_password", type="string", length=70, nullable=true) @@ -137,6 +169,8 @@ class User implements EntityInterface protected $catPassword; /** + * Cat encrypted password. + * * @var string|null * * @ORM\Column(name="cat_pass_enc", type="string", length=255, nullable=true) @@ -144,6 +178,8 @@ class User implements EntityInterface protected $catPassEnc; /** + * College. + * * @var string * * @ORM\Column(name="college", type="string", length=100, nullable=false) @@ -151,6 +187,8 @@ class User implements EntityInterface protected $college = ''; /** + * Major. + * * @var string * * @ORM\Column(name="major", type="string", length=100, nullable=false) @@ -158,6 +196,8 @@ class User implements EntityInterface protected $major = ''; /** + * Home library. + * * @var string * * @ORM\Column(name="home_library", type="string", length=100, nullable=true) @@ -165,13 +205,21 @@ class User implements EntityInterface protected $homeLibrary = ''; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; /** + * Verify hash. + * * @var string * * @ORM\Column(name="verify_hash", type="string", length=42, nullable=false) @@ -179,13 +227,21 @@ class User implements EntityInterface protected $verifyHash = ''; /** + * Time last loggedin. + * * @var \DateTime * - * @ORM\Column(name="last_login", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="last_login", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $lastLogin = '2000-01-01 00:00:00'; /** + * Method of authentication. + * * @var string|null * * @ORM\Column(name="auth_method", type="string", length=50, nullable=true) @@ -193,6 +249,8 @@ class User implements EntityInterface protected $authMethod; /** + * Last known language. + * * @var string * * @ORM\Column(name="last_language", type="string", length=30, nullable=false) diff --git a/module/VuFind/src/VuFind/Db/Entity/UserCard.php b/module/VuFind/src/VuFind/Db/Entity/UserCard.php index 7e776bfa04f..ee341b7f3fa 100644 --- a/module/VuFind/src/VuFind/Db/Entity/UserCard.php +++ b/module/VuFind/src/VuFind/Db/Entity/UserCard.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,30 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="user_card", indexes={@ORM\Index(name="user_card_cat_username", columns={"cat_username"}), @ORM\Index(name="user_id", columns={"user_id"})}) + * @ORM\Table(name="user_card", + * indexes={@ORM\Index(name="user_card_cat_username", columns={"cat_username"}), + * @ORM\Index(name="user_id", columns={"user_id"})}) * @ORM\Entity */ class UserCard implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Card name. + * * @var string * * @ORM\Column(name="card_name", type="string", length=255, nullable=false) @@ -60,6 +69,8 @@ class UserCard implements EntityInterface protected $cardName = ''; /** + * Cat username. + * * @var string * * @ORM\Column(name="cat_username", type="string", length=50, nullable=false) @@ -67,6 +78,8 @@ class UserCard implements EntityInterface protected $catUsername = ''; /** + * Cat password. + * * @var string|null * * @ORM\Column(name="cat_password", type="string", length=70, nullable=true) @@ -74,6 +87,8 @@ class UserCard implements EntityInterface protected $catPassword; /** + * Cat password (encrypted). + * * @var string|null * * @ORM\Column(name="cat_pass_enc", type="string", length=255, nullable=true) @@ -81,6 +96,8 @@ class UserCard implements EntityInterface protected $catPassEnc; /** + * Home library. + * * @var string * * @ORM\Column(name="home_library", type="string", length=100, nullable=true) @@ -88,25 +105,40 @@ class UserCard implements EntityInterface protected $homeLibrary = ''; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; /** + * Saved timestamp. + * * @var \DateTime * - * @ORM\Column(name="saved", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + * @ORM\Column(name="saved", + * type="datetime", + * nullable=false, + * options={"default"="CURRENT_TIMESTAMP"} + * ) */ protected $saved = 'CURRENT_TIMESTAMP'; /** + * User. + * * @var \VuFind\Db\Entity\User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id") * }) */ protected $user; diff --git a/module/VuFind/src/VuFind/Db/Entity/UserList.php b/module/VuFind/src/VuFind/Db/Entity/UserList.php index 87880442042..f2ddc1df4e3 100644 --- a/module/VuFind/src/VuFind/Db/Entity/UserList.php +++ b/module/VuFind/src/VuFind/Db/Entity/UserList.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,30 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="user_list", indexes={@ORM\Index(name="user_id", columns={"user_id"})}) + * @ORM\Table(name="user_list", + * indexes={@ORM\Index(name="user_id", columns={"user_id"})} + * ) * @ORM\Entity */ class UserList implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) * @ORM\Id + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Title of the list. + * * @var string * * @ORM\Column(name="title", type="string", length=200, nullable=false) @@ -60,6 +69,8 @@ class UserList implements EntityInterface protected $title; /** + * Description of the list. + * * @var string|null * * @ORM\Column(name="description", type="text", length=65535, nullable=true) @@ -67,13 +78,21 @@ class UserList implements EntityInterface protected $description; /** + * Creation date. + * * @var \DateTime * - * @ORM\Column(name="created", type="datetime", nullable=false, options={"default"="2000-01-01 00:00:00"}) + * @ORM\Column(name="created", + * type="datetime", + * nullable=false, + * options={"default"="2000-01-01 00:00:00"} + * ) */ protected $created = '2000-01-01 00:00:00'; /** + * Flag to indicate whether or not the list is public. + * * @var int * * @ORM\Column(name="public", type="integer", nullable=false) @@ -81,12 +100,15 @@ class UserList implements EntityInterface protected $public = '0'; /** + * User ID. + * * @var \VuFind\Db\Entity\User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") - * }) + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id" + * )}) */ protected $user; } diff --git a/module/VuFind/src/VuFind/Db/Entity/UserResource.php b/module/VuFind/src/VuFind/Db/Entity/UserResource.php index 3c3efefe64e..494953f62d8 100644 --- a/module/VuFind/src/VuFind/Db/Entity/UserResource.php +++ b/module/VuFind/src/VuFind/Db/Entity/UserResource.php @@ -4,7 +4,7 @@ * * PHP version 7 * - * Copyright (C) Villanova University 2021. + * Copyright (C) Villanova University 2023. * * This program is free software; you can redistribute it and/or modify * it under the terms of the GNU General Public License version 2, @@ -38,21 +38,32 @@ * @license http://opensource.org/licenses/gpl-2.0.php GNU General Public License * @link https://vufind.org/wiki/development:plugins:database_gateways Wiki * - * @ORM\Table(name="user_resource", indexes={@ORM\Index(name="list_id", columns={"list_id"}), @ORM\Index(name="resource_id", columns={"resource_id"}), @ORM\Index(name="user_id", columns={"user_id"})}) + * @ORM\Table(name="user_resource", + * indexes={@ORM\Index(name="list_id", columns={"list_id"}), + * @ORM\Index(name="resource_id", columns={"resource_id"}), + * @ORM\Index(name="user_id", columns={"user_id"})} + * ) * @ORM\Entity */ class UserResource implements EntityInterface { /** + * Unique ID. + * * @var int * - * @ORM\Column(name="id", type="integer", nullable=false) + * @ORM\Column(name="id", + * type="integer", + * nullable=false + * ) * @ORM\Id * @ORM\GeneratedValue(strategy="IDENTITY") */ protected $id; /** + * Notes associated with the resource. + * * @var string|null * * @ORM\Column(name="notes", type="text", length=65535, nullable=true) @@ -60,38 +71,52 @@ class UserResource implements EntityInterface protected $notes; /** + * Date saved. + * * @var \DateTime * - * @ORM\Column(name="saved", type="datetime", nullable=false, options={"default"="CURRENT_TIMESTAMP"}) + * @ORM\Column(name="saved", + * type="datetime", + * nullable=false, + * options={"default"="CURRENT_TIMESTAMP"}) */ protected $saved = 'CURRENT_TIMESTAMP'; /** + * User ID. + * * @var \VuFind\Db\Entity\User * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\User") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="user_id", referencedColumnName="id") + * @ORM\JoinColumn(name="user_id", + * referencedColumnName="id") * }) */ protected $user; /** + * Resource. + * * @var \VuFind\Db\Entity\Resource * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\Resource") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="resource_id", referencedColumnName="id") + * @ORM\JoinColumn(name="resource_id", + * referencedColumnName="id") * }) */ protected $resource; /** + * User list ID. + * * @var \VuFind\Db\Entity\UserList * * @ORM\ManyToOne(targetEntity="VuFind\Db\Entity\UserList") * @ORM\JoinColumns({ - * @ORM\JoinColumn(name="list_id", referencedColumnName="id") + * @ORM\JoinColumn(name="list_id", + * referencedColumnName="id") * }) */ protected $list; diff --git a/module/VuFind/src/VuFind/Db/Service/TagService.php b/module/VuFind/src/VuFind/Db/Service/TagService.php index 8a3e019a37b..78e88d0592c 100644 --- a/module/VuFind/src/VuFind/Db/Service/TagService.php +++ b/module/VuFind/src/VuFind/Db/Service/TagService.php @@ -97,6 +97,7 @@ public function getAnonymousCount(): int $stats = current($query->getResult()); return $stats['total']; } + /** * Given an array for sorting database results, make sure the tag field is * sorted in a case-insensitive fashion and that no illegal fields are