SQLSTATEMENTS
in package
SQLSTATEMENTS
Some default SQL statements/clauses for LIST/SEARCH operations.
Table of Contents
Properties
- $allIds : bool
- bool
- $basket : bool
- bool
- $conditions : array<string|int, mixed>
- array
- $conditionsOneField : array<string|int, mixed>
- array
- $exportList : bool
- bool
- $joins : array<string|int, mixed>
- array
- $listMethodAscDesc : string
- string
- $listQuarantined : string|false
- string
- $listType : string
- string
- $metadataPaging : bool
- bool
- $totalResourceSubquery : string
- string
Methods
- __construct() : mixed
- SQLSTATEMENTS
- advsearchBib() : void
- Create SQL statement to exclude or include resources in a list being returned if they exist in a user bibliography. Used from Advanced Search.
- executeCondJoins() : void
- Execute any conditions and joins
- frontSetDays() : array<string|int, mixed>
- Select front page resources according to $limit resources from last $days
- frontSetNumber() : array<string|int, mixed>
- Select front page resources according to latest $limit resources
- getCreatorOrderSubquery() : string
- Return a subQuery providing 'creatorSurname' as an order Used in BIBCITEGATEWAY
- getOrderCreator() : string
- Get SQL ordering for creator
- getOrderYear() : string
- Get SQL ordering for year
- quarantine() : void
- Conditions for quarantined resources
- setListOrder() : void
- Set ordering for list and search operations (not for cited text) Used in BIBCITEGATEWAY and LISTCOMMON (for dictionary paging)
- yearOrder() : string
- Create special CASE WHEN statement when ordering by year
Properties
$allIds
bool
public
bool
$allIds
= \FALSE
$basket
bool
public
bool
$basket
= \FALSE
$conditions
array
public
array<string|int, mixed>
$conditions
= []
$conditionsOneField
array
public
array<string|int, mixed>
$conditionsOneField
= []
$exportList
bool
public
bool
$exportList
= \TRUE
$joins
array
public
array<string|int, mixed>
$joins
= []
$listMethodAscDesc
string
public
string
$listMethodAscDesc
= 'list_AscDesc'
$listQuarantined
string
public
string|false
$listQuarantined
= \FALSE
$listType
string
public
string
$listType
= 'list'
$metadataPaging
bool
public
bool
$metadataPaging
= \FALSE
$totalResourceSubquery
string
public
string
$totalResourceSubquery
Methods
__construct()
SQLSTATEMENTS
public
__construct() : mixed
advsearchBib()
Create SQL statement to exclude or include resources in a list being returned if they exist in a user bibliography. Used from Advanced Search.
public
advsearchBib(array<string|int, mixed> $bibIds, string $bibIdsButton[, string $matchField = 'resourceId' ]) : void
result is a tidied SQL condition such as:
(matchField NOT IN (
SELECT userbibliographyresourceResourceId FROM user_bibliography_resource
WHERE (userbibliographyresourceBibliographyId = 1)
)
Parameters
- $bibIds : array<string|int, mixed>
-
user bibliography ids
- $bibIdsButton : string
- $matchField : string = 'resourceId'
-
databasefield to be searched for Default 'resourceId'
executeCondJoins()
Execute any conditions and joins
public
executeCondJoins() : void
frontSetDays()
Select front page resources according to $limit resources from last $days
public
frontSetDays(int $days, int $limit) : array<string|int, mixed>
Parameters
- $days : int
- $limit : int
Return values
array<string|int, mixed>frontSetNumber()
Select front page resources according to latest $limit resources
public
frontSetNumber(int $limit) : array<string|int, mixed>
Parameters
- $limit : int
Return values
array<string|int, mixed>getCreatorOrderSubquery()
Return a subQuery providing 'creatorSurname' as an order Used in BIBCITEGATEWAY
public
getCreatorOrderSubquery(array<string|int, mixed> $resIds, int $editorSwitch, int $usePrefix) : string
Parameters
- $resIds : array<string|int, mixed>
- $editorSwitch : int
- $usePrefix : int
Return values
stringgetOrderCreator()
Get SQL ordering for creator
public
getOrderCreator() : string
Return values
stringgetOrderYear()
Get SQL ordering for year
public
getOrderYear() : string
For some resource types, year1 is original publication year, year2 field is a reprint/revision year so year2 this provides the order
Return values
stringquarantine()
Conditions for quarantined resources
public
quarantine([bool $front = false ][, string $joinId = 'resourceId' ][, bool $joinMisc = true ][, bool $coSubquery = false ]) : void
Parameters
- $front : bool = false
-
Default is FALSE
- $joinId : string = 'resourceId'
-
Default is 'resourceId'
- $joinMisc : bool = true
-
Default is TRUE
- $coSubquery : bool = false
-
Default is FALSE
setListOrder()
Set ordering for list and search operations (not for cited text) Used in BIBCITEGATEWAY and LISTCOMMON (for dictionary paging)
public
setListOrder(array<string|int, mixed> $listParams) : void
Parameters
- $listParams : array<string|int, mixed>
yearOrder()
Create special CASE WHEN statement when ordering by year
public
yearOrder() : string