@@ -384,7 +384,7 @@ discard block |
||
384 | 384 | |
385 | 385 | $excludeOtherWhere = ''; |
386 | 386 | if ($settings['excludeOther']) { |
387 | - $excludeOtherWhere = 'tx_dlf_documents.pid=' . intval($settings['storagePid']); |
|
387 | + $excludeOtherWhere = 'tx_dlf_documents.pid='.intval($settings['storagePid']); |
|
388 | 388 | } |
389 | 389 | // Check if there are any metadata to suggest. |
390 | 390 | return $queryBuilder |
@@ -438,12 +438,12 @@ discard block |
||
438 | 438 | $connection = GeneralUtility::makeInstance(ConnectionPool::class) |
439 | 439 | ->getConnectionForTable('tx_dlf_documents'); |
440 | 440 | |
441 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
442 | - 'FROM `tx_dlf_documents` ' . |
|
443 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
444 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
445 | - 'WHERE `tx_dlf_documents`.`record_id` = ? ' . |
|
446 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
441 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
442 | + 'FROM `tx_dlf_documents` '. |
|
443 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
444 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
445 | + 'WHERE `tx_dlf_documents`.`record_id` = ? '. |
|
446 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
447 | 447 | $where; |
448 | 448 | |
449 | 449 | $values = [ |
@@ -474,13 +474,13 @@ discard block |
||
474 | 474 | $connection = GeneralUtility::makeInstance(ConnectionPool::class) |
475 | 475 | ->getConnectionForTable('tx_dlf_documents'); |
476 | 476 | |
477 | - $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` ' . |
|
478 | - 'FROM `tx_dlf_documents` ' . |
|
479 | - 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` ' . |
|
480 | - 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` ' . |
|
481 | - 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) ' . |
|
482 | - 'AND `tx_dlf_relations`.`ident`="docs_colls" ' . |
|
483 | - 'AND ' . Helper::whereExpression('tx_dlf_collections') . ' ' . |
|
477 | + $sql = 'SELECT `tx_dlf_documents`.*, GROUP_CONCAT(DISTINCT `tx_dlf_collections`.`oai_name` ORDER BY `tx_dlf_collections`.`oai_name` SEPARATOR " ") AS `collections` '. |
|
478 | + 'FROM `tx_dlf_documents` '. |
|
479 | + 'INNER JOIN `tx_dlf_relations` ON `tx_dlf_relations`.`uid_local` = `tx_dlf_documents`.`uid` '. |
|
480 | + 'INNER JOIN `tx_dlf_collections` ON `tx_dlf_collections`.`uid` = `tx_dlf_relations`.`uid_foreign` '. |
|
481 | + 'WHERE `tx_dlf_documents`.`uid` IN ( ? ) '. |
|
482 | + 'AND `tx_dlf_relations`.`ident`="docs_colls" '. |
|
483 | + 'AND '.Helper::whereExpression('tx_dlf_collections').' '. |
|
484 | 484 | 'GROUP BY `tx_dlf_documents`.`uid` '; |
485 | 485 | |
486 | 486 | $values = [ |
@@ -36,8 +36,7 @@ discard block |
||
36 | 36 | * |
37 | 37 | * @access public |
38 | 38 | */ |
39 | -class DocumentRepository extends Repository |
|
40 | -{ |
|
39 | +class DocumentRepository extends Repository { |
|
41 | 40 | /** |
42 | 41 | * @access protected |
43 | 42 | * @var array The controller settings passed to the repository for some special actions. |
@@ -61,8 +60,7 @@ discard block |
||
61 | 60 | * |
62 | 61 | * @return Document|null |
63 | 62 | */ |
64 | - public function findOneByParameters($parameters) |
|
65 | - { |
|
63 | + public function findOneByParameters($parameters) { |
|
66 | 64 | $doc = null; |
67 | 65 | $document = null; |
68 | 66 | |
@@ -108,8 +106,7 @@ discard block |
||
108 | 106 | * |
109 | 107 | * @return Document|null |
110 | 108 | */ |
111 | - public function findOldestDocument() |
|
112 | - { |
|
109 | + public function findOldestDocument() { |
|
113 | 110 | $query = $this->createQuery(); |
114 | 111 | |
115 | 112 | $query->setOrderings(['tstamp' => QueryInterface::ORDER_ASCENDING]); |
@@ -126,8 +123,7 @@ discard block |
||
126 | 123 | * |
127 | 124 | * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface |
128 | 125 | */ |
129 | - public function getChildrenOfYearAnchor($partOf, $structure) |
|
130 | - { |
|
126 | + public function getChildrenOfYearAnchor($partOf, $structure) { |
|
131 | 127 | $query = $this->createQuery(); |
132 | 128 | |
133 | 129 | $query->matching($query->equals('structure', $structure)); |
@@ -150,8 +146,7 @@ discard block |
||
150 | 146 | * |
151 | 147 | * @return Document|null |
152 | 148 | */ |
153 | - public function findOneByIdAndSettings($uid, $settings = []) |
|
154 | - { |
|
149 | + public function findOneByIdAndSettings($uid, $settings = []) { |
|
155 | 150 | $settings = ['documentSets' => $uid]; |
156 | 151 | |
157 | 152 | return $this->findDocumentsBySettings($settings)->getFirst(); |
@@ -166,8 +161,7 @@ discard block |
||
166 | 161 | * |
167 | 162 | * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface |
168 | 163 | */ |
169 | - public function findDocumentsBySettings($settings = []) |
|
170 | - { |
|
164 | + public function findDocumentsBySettings($settings = []) { |
|
171 | 165 | $query = $this->createQuery(); |
172 | 166 | |
173 | 167 | $constraints = []; |
@@ -200,8 +194,7 @@ discard block |
||
200 | 194 | * |
201 | 195 | * @return array|\TYPO3\CMS\Extbase\Persistence\QueryResultInterface |
202 | 196 | */ |
203 | - public function findAllByCollectionsLimited($collections, int $limit = 50, int $offset = 0) |
|
204 | - { |
|
197 | + public function findAllByCollectionsLimited($collections, int $limit = 50, int $offset = 0) { |
|
205 | 198 | $query = $this->createQuery(); |
206 | 199 | |
207 | 200 | // order by start_date -> start_time... |
@@ -241,8 +234,7 @@ discard block |
||
241 | 234 | * |
242 | 235 | * @return array |
243 | 236 | */ |
244 | - public function getStatisticsForSelectedCollection($settings) |
|
245 | - { |
|
237 | + public function getStatisticsForSelectedCollection($settings) { |
|
246 | 238 | if ($settings['collections']) { |
247 | 239 | // Include only selected collections. |
248 | 240 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
@@ -378,8 +370,7 @@ discard block |
||
378 | 370 | * |
379 | 371 | * @return Result |
380 | 372 | */ |
381 | - public function getTableOfContentsFromDb($uid, $pid, $settings) |
|
382 | - { |
|
373 | + public function getTableOfContentsFromDb($uid, $pid, $settings) { |
|
383 | 374 | // Build table of contents from database. |
384 | 375 | $queryBuilder = GeneralUtility::makeInstance(ConnectionPool::class) |
385 | 376 | ->getQueryBuilderForTable('tx_dlf_documents'); |
@@ -429,8 +420,7 @@ discard block |
||
429 | 420 | * |
430 | 421 | * @return array The found document object |
431 | 422 | */ |
432 | - public function getOaiRecord($settings, $parameters) |
|
433 | - { |
|
423 | + public function getOaiRecord($settings, $parameters) { |
|
434 | 424 | $where = ''; |
435 | 425 | |
436 | 426 | if (!$settings['show_userdefined']) { |
@@ -507,8 +497,7 @@ discard block |
||
507 | 497 | * |
508 | 498 | * @return array |
509 | 499 | */ |
510 | - public function findAllByUids($uids, $checkPartof = false) |
|
511 | - { |
|
500 | + public function findAllByUids($uids, $checkPartof = false) { |
|
512 | 501 | // get all documents from db we are talking about |
513 | 502 | $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class); |
514 | 503 | $queryBuilder = $connectionPool->getQueryBuilderForTable('tx_dlf_documents'); |
@@ -557,8 +546,7 @@ discard block |
||
557 | 546 | * |
558 | 547 | * @return array |
559 | 548 | */ |
560 | - public function findChildrenOfEach(array $uids) |
|
561 | - { |
|
549 | + public function findChildrenOfEach(array $uids) { |
|
562 | 550 | $allDocuments = $this->findAllByUids($uids, true); |
563 | 551 | |
564 | 552 | $result = []; |
@@ -583,8 +571,7 @@ discard block |
||
583 | 571 | * |
584 | 572 | * @return SolrSearch |
585 | 573 | */ |
586 | - public function findSolrByCollection(Collection $collection, $settings, $searchParams, $listedMetadata = null, $indexedMetadata = null) |
|
587 | - { |
|
574 | + public function findSolrByCollection(Collection $collection, $settings, $searchParams, $listedMetadata = null, $indexedMetadata = null) { |
|
588 | 575 | return $this->findSolr([$collection], $settings, $searchParams, $listedMetadata, $indexedMetadata); |
589 | 576 | } |
590 | 577 |
@@ -63,8 +63,8 @@ discard block |
||
63 | 63 | */ |
64 | 64 | public function findOneByParameters($parameters) |
65 | 65 | { |
66 | - $doc = null; |
|
67 | - $document = null; |
|
66 | + $doc = NULL; |
|
67 | + $document = NULL; |
|
68 | 68 | |
69 | 69 | if (isset($parameters['id']) && MathUtility::canBeInterpretedAsInteger($parameters['id'])) { |
70 | 70 | |
@@ -76,13 +76,13 @@ discard block |
||
76 | 76 | |
77 | 77 | } else if (isset($parameters['location']) && GeneralUtility::isValidUrl($parameters['location'])) { |
78 | 78 | |
79 | - $doc = AbstractDocument::getInstance($parameters['location'], [], true); |
|
79 | + $doc = AbstractDocument::getInstance($parameters['location'], [], TRUE); |
|
80 | 80 | |
81 | 81 | if ($doc->recordId) { |
82 | 82 | $document = $this->findOneByRecordId($doc->recordId); |
83 | 83 | } |
84 | 84 | |
85 | - if ($document === null) { |
|
85 | + if ($document === NULL) { |
|
86 | 86 | // create new (dummy) Document object |
87 | 87 | $document = GeneralUtility::makeInstance(Document::class); |
88 | 88 | $document->setLocation($parameters['location']); |
@@ -90,11 +90,11 @@ discard block |
||
90 | 90 | |
91 | 91 | } |
92 | 92 | |
93 | - if ($document !== null && $doc === null) { |
|
94 | - $doc = AbstractDocument::getInstance($document->getLocation(), [], true); |
|
93 | + if ($document !== NULL && $doc === NULL) { |
|
94 | + $doc = AbstractDocument::getInstance($document->getLocation(), [], TRUE); |
|
95 | 95 | } |
96 | 96 | |
97 | - if ($doc !== null) { |
|
97 | + if ($doc !== NULL) { |
|
98 | 98 | $document->setCurrentDocument($doc); |
99 | 99 | } |
100 | 100 | |
@@ -177,7 +177,7 @@ discard block |
||
177 | 177 | } |
178 | 178 | |
179 | 179 | if (isset($settings['excludeOther']) && (int) $settings['excludeOther'] === 0) { |
180 | - $query->getQuerySettings()->setRespectStoragePage(false); |
|
180 | + $query->getQuerySettings()->setRespectStoragePage(FALSE); |
|
181 | 181 | } |
182 | 182 | |
183 | 183 | if (count($constraints)) { |
@@ -507,7 +507,7 @@ discard block |
||
507 | 507 | * |
508 | 508 | * @return array |
509 | 509 | */ |
510 | - public function findAllByUids($uids, $checkPartof = false) |
|
510 | + public function findAllByUids($uids, $checkPartof = FALSE) |
|
511 | 511 | { |
512 | 512 | // get all documents from db we are talking about |
513 | 513 | $connectionPool = GeneralUtility::makeInstance(ConnectionPool::class); |
@@ -559,7 +559,7 @@ discard block |
||
559 | 559 | */ |
560 | 560 | public function findChildrenOfEach(array $uids) |
561 | 561 | { |
562 | - $allDocuments = $this->findAllByUids($uids, true); |
|
562 | + $allDocuments = $this->findAllByUids($uids, TRUE); |
|
563 | 563 | |
564 | 564 | $result = []; |
565 | 565 | foreach ($allDocuments as $doc) { |
@@ -583,7 +583,7 @@ discard block |
||
583 | 583 | * |
584 | 584 | * @return SolrSearch |
585 | 585 | */ |
586 | - public function findSolrByCollection(Collection $collection, $settings, $searchParams, $listedMetadata = null, $indexedMetadata = null) |
|
586 | + public function findSolrByCollection(Collection $collection, $settings, $searchParams, $listedMetadata = NULL, $indexedMetadata = NULL) |
|
587 | 587 | { |
588 | 588 | return $this->findSolr([$collection], $settings, $searchParams, $listedMetadata, $indexedMetadata); |
589 | 589 | } |
@@ -601,7 +601,7 @@ discard block |
||
601 | 601 | * |
602 | 602 | * @return SolrSearch |
603 | 603 | */ |
604 | - public function findSolrByCollections($collections, $settings, $searchParams, $listedMetadata = null, $indexedMetadata = null): SolrSearch |
|
604 | + public function findSolrByCollections($collections, $settings, $searchParams, $listedMetadata = NULL, $indexedMetadata = NULL): SolrSearch |
|
605 | 605 | { |
606 | 606 | return $this->findSolr($collections, $settings, $searchParams, $listedMetadata, $indexedMetadata); |
607 | 607 | } |
@@ -618,7 +618,7 @@ discard block |
||
618 | 618 | * |
619 | 619 | * @return SolrSearch |
620 | 620 | */ |
621 | - public function findSolrWithoutCollection($settings, $searchParams, $listedMetadata = null, $indexedMetadata = null): SolrSearch |
|
621 | + public function findSolrWithoutCollection($settings, $searchParams, $listedMetadata = NULL, $indexedMetadata = NULL): SolrSearch |
|
622 | 622 | { |
623 | 623 | return $this->findSolr([], $settings, $searchParams, $listedMetadata, $indexedMetadata); |
624 | 624 | } |
@@ -635,7 +635,7 @@ discard block |
||
635 | 635 | * |
636 | 636 | * @return SolrSearch |
637 | 637 | */ |
638 | - private function findSolr($collections, $settings, $searchParams, $listedMetadata = null, $indexedMetadata = null): SolrSearch |
|
638 | + private function findSolr($collections, $settings, $searchParams, $listedMetadata = NULL, $indexedMetadata = NULL): SolrSearch |
|
639 | 639 | { |
640 | 640 | // set settings global inside this repository |
641 | 641 | // (may be necessary when SolrSearch calls back) |
@@ -22,7 +22,6 @@ |
||
22 | 22 | * |
23 | 23 | * @access public |
24 | 24 | */ |
25 | -class MetadataFormatRepository extends Repository |
|
26 | -{ |
|
25 | +class MetadataFormatRepository extends Repository { |
|
27 | 26 | |
28 | 27 | } |
@@ -28,8 +28,7 @@ |
||
28 | 28 | * |
29 | 29 | * @access public |
30 | 30 | */ |
31 | -class CollectionRepository extends Repository |
|
32 | -{ |
|
31 | +class CollectionRepository extends Repository { |
|
33 | 32 | /** |
34 | 33 | * @access protected |
35 | 34 | * @var array Set the default ordering. This is applied to findAll(), too. |
@@ -22,7 +22,6 @@ |
||
22 | 22 | * |
23 | 23 | * @access public |
24 | 24 | */ |
25 | -class PrinterRepository extends Repository |
|
26 | -{ |
|
25 | +class PrinterRepository extends Repository { |
|
27 | 26 | |
28 | 27 | } |
@@ -22,8 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @access public |
24 | 24 | */ |
25 | -class Structure extends AbstractEntity |
|
26 | -{ |
|
25 | +class Structure extends AbstractEntity { |
|
27 | 26 | /** |
28 | 27 | * @access protected |
29 | 28 | * @var Structure |
@@ -23,8 +23,7 @@ |
||
23 | 23 | * |
24 | 24 | * @access public |
25 | 25 | */ |
26 | -class Collection extends AbstractEntity |
|
27 | -{ |
|
26 | +class Collection extends AbstractEntity { |
|
28 | 27 | /** |
29 | 28 | * @access protected |
30 | 29 | * @var int |
@@ -71,7 +71,7 @@ |
||
71 | 71 | * @access protected |
72 | 72 | * @var FileReference thumbnail |
73 | 73 | */ |
74 | - protected $thumbnail = null; |
|
74 | + protected $thumbnail = NULL; |
|
75 | 75 | |
76 | 76 | /** |
77 | 77 | * @access protected |
@@ -22,8 +22,7 @@ |
||
22 | 22 | * |
23 | 23 | * @access public |
24 | 24 | */ |
25 | -class Mail extends AbstractEntity |
|
26 | -{ |
|
25 | +class Mail extends AbstractEntity { |
|
27 | 26 | /** |
28 | 27 | * @access protected |
29 | 28 | * @var string |
@@ -26,8 +26,7 @@ discard block |
||
26 | 26 | * |
27 | 27 | * @access public |
28 | 28 | */ |
29 | -class Document extends AbstractEntity |
|
30 | -{ |
|
29 | +class Document extends AbstractEntity { |
|
31 | 30 | /** |
32 | 31 | * @access protected |
33 | 32 | * @var \DateTime |
@@ -225,14 +224,12 @@ discard block |
||
225 | 224 | /** |
226 | 225 | * constructor |
227 | 226 | */ |
228 | - public function __construct() |
|
229 | - { |
|
227 | + public function __construct() { |
|
230 | 228 | // Do not remove the next line: It would break the functionality |
231 | 229 | $this->initStorageObjects(); |
232 | 230 | } |
233 | 231 | |
234 | - protected function initStorageObjects() |
|
235 | - { |
|
232 | + protected function initStorageObjects() { |
|
236 | 233 | $this->collections = new ObjectStorage(); |
237 | 234 | } |
238 | 235 | |
@@ -610,8 +607,7 @@ discard block |
||
610 | 607 | * |
611 | 608 | * @return ObjectStorage<Collection> $collections |
612 | 609 | */ |
613 | - public function getCollections() |
|
614 | - { |
|
610 | + public function getCollections() { |
|
615 | 611 | return $this->collections; |
616 | 612 | } |
617 | 613 |
@@ -44,7 +44,7 @@ discard block |
||
44 | 44 | * @access protected |
45 | 45 | * @var AbstractDocument|null This contains the representative of the raw XML / IIIF data of the document. |
46 | 46 | */ |
47 | - protected $currentDocument = null; |
|
47 | + protected $currentDocument = NULL; |
|
48 | 48 | |
49 | 49 | /** |
50 | 50 | * @access protected |
@@ -183,7 +183,7 @@ discard block |
||
183 | 183 | * @var ObjectStorage<Collection> |
184 | 184 | * @Extbase\ORM\Lazy |
185 | 185 | */ |
186 | - protected $collections = null; |
|
186 | + protected $collections = NULL; |
|
187 | 187 | |
188 | 188 | /** |
189 | 189 | * @access protected |
@@ -24,8 +24,7 @@ discard block |
||
24 | 24 | * |
25 | 25 | * @access public |
26 | 26 | */ |
27 | -class Metadata extends AbstractEntity |
|
28 | -{ |
|
27 | +class Metadata extends AbstractEntity { |
|
29 | 28 | /** |
30 | 29 | * @access protected |
31 | 30 | * @var Metadata |
@@ -128,14 +127,12 @@ discard block |
||
128 | 127 | /** |
129 | 128 | * constructor |
130 | 129 | */ |
131 | - public function __construct() |
|
132 | - { |
|
130 | + public function __construct() { |
|
133 | 131 | // Do not remove the next line: It would break the functionality |
134 | 132 | $this->initStorageObjects(); |
135 | 133 | } |
136 | 134 | |
137 | - protected function initStorageObjects() |
|
138 | - { |
|
135 | + protected function initStorageObjects() { |
|
139 | 136 | $this->format = new ObjectStorage(); |
140 | 137 | } |
141 | 138 | |
@@ -206,8 +203,7 @@ discard block |
||
206 | 203 | /** |
207 | 204 | * @return ObjectStorage<MetadataFormat> $format |
208 | 205 | */ |
209 | - public function getFormat() |
|
210 | - { |
|
206 | + public function getFormat() { |
|
211 | 207 | return $this->format; |
212 | 208 | } |
213 | 209 | |
@@ -226,8 +222,7 @@ discard block |
||
226 | 222 | * |
227 | 223 | * @return void |
228 | 224 | */ |
229 | - public function addFormat(MetadataFormat $format) |
|
230 | - { |
|
225 | + public function addFormat(MetadataFormat $format) { |
|
231 | 226 | $this->format->attach($format); |
232 | 227 | } |
233 | 228 | |
@@ -238,8 +233,7 @@ discard block |
||
238 | 233 | * |
239 | 234 | * @return void |
240 | 235 | */ |
241 | - public function removeFormat(MetadataFormat $formatToRemove) |
|
242 | - { |
|
236 | + public function removeFormat(MetadataFormat $formatToRemove) { |
|
243 | 237 | $this->format->detach($formatToRemove); |
244 | 238 | } |
245 | 239 |