|
|
|
@ -23,18 +23,18 @@ namespace BSR\Lib\db;
|
|
|
|
* @property string sql_collection
|
|
|
|
* @property string sql_collection
|
|
|
|
* @property string isbn
|
|
|
|
* @property string isbn
|
|
|
|
* @property string sql_isbn
|
|
|
|
* @property string sql_isbn
|
|
|
|
* @property string readBy
|
|
|
|
* @property string reader
|
|
|
|
* @property string sql_readBy
|
|
|
|
* @property string sql_reader
|
|
|
|
* @property string cover
|
|
|
|
* @property string cover
|
|
|
|
* @property string sql_cover
|
|
|
|
* @property string sql_cover
|
|
|
|
* @property string category
|
|
|
|
* @property string category
|
|
|
|
* @property string sql_category
|
|
|
|
* @property string sql_category
|
|
|
|
* @property string date
|
|
|
|
* @property string availabilityDate
|
|
|
|
* @property string sql_date
|
|
|
|
* @property string sql_availabilityDate
|
|
|
|
* @property string code3
|
|
|
|
* @property string producerCode
|
|
|
|
* @property string sql_code3
|
|
|
|
* @property string sql_producerCode
|
|
|
|
* @property string code3Long
|
|
|
|
* @property string producer
|
|
|
|
* @property string sql_code3Long
|
|
|
|
* @property string sql_producer
|
|
|
|
* @property string genre
|
|
|
|
* @property string genre
|
|
|
|
* @property string sql_genre
|
|
|
|
* @property string sql_genre
|
|
|
|
* @property string genreCode
|
|
|
|
* @property string genreCode
|
|
|
|
@ -45,12 +45,12 @@ namespace BSR\Lib\db;
|
|
|
|
* @property string sql_link
|
|
|
|
* @property string sql_link
|
|
|
|
* @property string linkTitle
|
|
|
|
* @property string linkTitle
|
|
|
|
* @property string sql_linkTitle
|
|
|
|
* @property string sql_linkTitle
|
|
|
|
* @property string typeMedia1
|
|
|
|
* @property string mediaType
|
|
|
|
* @property string sql_typeMedia1
|
|
|
|
* @property string sql_mediaType
|
|
|
|
*/
|
|
|
|
*/
|
|
|
|
class AudioBook extends DbMapping
|
|
|
|
class AudioBook extends DbMapping
|
|
|
|
{
|
|
|
|
{
|
|
|
|
protected $attributeNames = 'id title author code summary editor media collection isbn readBy reader cover category date code3 code3Long genre genreCode coverdisplay link linkTitle mediaType typeMedia1';
|
|
|
|
protected $attributeNames = 'id title author code summary editor media collection isbn reader cover category availabilityDate producerCode producer genre genreCode coverdisplay link linkTitle mediaType';
|
|
|
|
|
|
|
|
|
|
|
|
public static function find($id) {
|
|
|
|
public static function find($id) {
|
|
|
|
return self::findBy('NoticeID', $id);
|
|
|
|
return self::findBy('NoticeID', $id);
|
|
|
|
@ -88,22 +88,20 @@ class AudioBook extends DbMapping
|
|
|
|
Fields.[490a] AS collection,
|
|
|
|
Fields.[490a] AS collection,
|
|
|
|
isbn.DisplayText AS isbn,
|
|
|
|
isbn.DisplayText AS isbn,
|
|
|
|
Fields.[901] AS reader,
|
|
|
|
Fields.[901] AS reader,
|
|
|
|
Fields.[901] AS readBy, -- for compatibility
|
|
|
|
|
|
|
|
Fields.[899a] AS cover,
|
|
|
|
Fields.[899a] AS cover,
|
|
|
|
'' AS category, -- supposed to come from tags 600, 610, 650, 651, 655, 690, 691, 695, 696 but always empty anyway
|
|
|
|
'' AS category, -- supposed to come from tags 600, 610, 650, 651, 655, 690, 691, 695, 696 but always empty anyway
|
|
|
|
CONVERT(VARCHAR, Notices.[CreationDate], 102) AS date,
|
|
|
|
item1.AcquisitionDate AS availabilityDate,
|
|
|
|
LTRIM(RTRIM(Notices.[userdefined3code])) AS code3,
|
|
|
|
ProducerCode.TextFre As producer,
|
|
|
|
[Code3].TextFre AS code3Long,
|
|
|
|
LTRIM(RTRIM(ProducerCode.Code)) AS producerCode,
|
|
|
|
[GenreCode].TextFre AS genre,
|
|
|
|
GenreCode.TextFre As genre,
|
|
|
|
[GenreCode].Code AS genreCode,
|
|
|
|
LTRIM(RTRIM(GenreCode.Code)) AS genreCode,
|
|
|
|
Notices.[coverdisplay],
|
|
|
|
Notices.[coverdisplay],
|
|
|
|
Fields.[856u] AS link,
|
|
|
|
Fields.[856u] AS link,
|
|
|
|
Fields.[856z] AS linkTitle,
|
|
|
|
Fields.[856z] AS linkTitle,
|
|
|
|
Notices.[MediaType1Code] AS mediaType,
|
|
|
|
Notices.[MediaType1Code] AS mediaType,
|
|
|
|
Notices.[MediaType1Code] AS typeMedia1 -- for compatibility
|
|
|
|
|
|
|
|
FROM Notices
|
|
|
|
FROM Notices
|
|
|
|
INNER JOIN Codes AS Code3 ON Notices.userdefined3code = Code3.Code AND Code3.Type=6
|
|
|
|
INNER JOIN Codes As GenreCode ON Notices.MediaType2Code = GenreCode.Code AND GenreCode.Type = 2
|
|
|
|
INNER JOIN Codes AS GenreCode ON MediaType2Code = GenreCode.Code AND GenreCode.Type = 2
|
|
|
|
INNER JOIN Codes AS ProducerCode ON Notices.userdefined3code = ProducerCode.Code AND ProducerCode.Type=6
|
|
|
|
LEFT OUTER JOIN (
|
|
|
|
LEFT OUTER JOIN (
|
|
|
|
SELECT *
|
|
|
|
SELECT *
|
|
|
|
FROM (
|
|
|
|
FROM (
|
|
|
|
@ -137,6 +135,11 @@ class AudioBook extends DbMapping
|
|
|
|
FOR Field IN ([520], [901], [300], [020], [490a], [260b], [260c], [856u], [856z], [899a])
|
|
|
|
FOR Field IN ([520], [901], [300], [020], [490a], [260b], [260c], [856u], [856z], [899a])
|
|
|
|
) AS pvt
|
|
|
|
) AS pvt
|
|
|
|
) Fields ON Notices.NoticeID = Fields.NoticeID
|
|
|
|
) Fields ON Notices.NoticeID = Fields.NoticeID
|
|
|
|
|
|
|
|
OUTER APPLY (
|
|
|
|
|
|
|
|
SELECT TOP 1 *
|
|
|
|
|
|
|
|
FROM Items
|
|
|
|
|
|
|
|
WHERE Notices.NoticeID = NoticeId
|
|
|
|
|
|
|
|
) AS item1
|
|
|
|
LEFT JOIN Authorities AS isbn ON isbn.AuthorityID = Fields.[020]
|
|
|
|
LEFT JOIN Authorities AS isbn ON isbn.AuthorityID = Fields.[020]
|
|
|
|
WHERE
|
|
|
|
WHERE
|
|
|
|
LTRIM(RTRIM(Notices.[%s])) IN ('%s')
|
|
|
|
LTRIM(RTRIM(Notices.[%s])) IN ('%s')
|
|
|
|
|