• Home
  • Features
  • Pricing
  • Docs
  • Announcements
  • Sign In

Yoast / Yoast-SEO-for-TYPO3 / 13327579701

14 Feb 2025 10:43AM UTC coverage: 1.276%. First build
13327579701

push

github

web-flow
Merge pull request #597 from Yoast/feature/v11

[FEATURE] Release 11.0.0

21 of 894 new or added lines in 76 files covered. (2.35%)

35 of 2744 relevant lines covered (1.28%)

0.04 hits per line

Source File
Press 'n' to go to next uncovered line, 'b' for previous

0.0
/Classes/Service/PageLayoutHeader/PageDataService.php
1
<?php
2

3
declare(strict_types=1);
4

5
namespace YoastSeoForTypo3\YoastSeo\Service\PageLayoutHeader;
6

7
use TYPO3\CMS\Backend\Controller\PageLayoutController;
8
use TYPO3\CMS\Backend\Template\ModuleTemplate;
9
use TYPO3\CMS\Backend\Utility\BackendUtility;
10

11
class PageDataService
12
{
13
    /**
14
     * @return array<string, string>|null
15
     */
16
    public function getCurrentPage(int $pageId, int $languageId, PageLayoutController|ModuleTemplate|null $parentObj): ?array
17
    {
NEW
18
        if ((!$parentObj instanceof PageLayoutController && !$parentObj instanceof ModuleTemplate) || $pageId <= 0) {
×
NEW
19
            return null;
×
20
        }
21

NEW
22
        if ($languageId === 0) {
×
NEW
23
            return $this->getPageRecord($pageId);
×
24
        }
25

NEW
26
        if ($languageId > 0) {
×
NEW
27
            $overlayRecords = $this->getOverlayRecords($pageId, $languageId);
×
28

NEW
29
            if (is_array($overlayRecords[0] ?? false)) {
×
NEW
30
                return $overlayRecords[0];
×
31
            }
32
        }
33

NEW
34
        return null;
×
35
    }
36

37
    /**
38
     * @return array<string, string>
39
     */
40
    protected function getPageRecord(int $pageId): array
41
    {
NEW
42
        return BackendUtility::getRecord(
×
NEW
43
            'pages',
×
NEW
44
            $pageId
×
NEW
45
        ) ?? [];
×
46
    }
47

48
    /**
49
     * @return array<string, string>|bool
50
     */
51
    protected function getOverlayRecords(int $pageId, int $languageId): array|bool
52
    {
NEW
53
        return BackendUtility::getRecordLocalization(
×
NEW
54
            'pages',
×
NEW
55
            $pageId,
×
NEW
56
            $languageId
×
NEW
57
        );
×
58
    }
59
}
STATUS · Troubleshooting · Open an Issue · Sales · Support · CAREERS · ENTERPRISE · START FREE · SCHEDULE DEMO
ANNOUNCEMENTS · TWITTER · TOS & SLA · Supported CI Services · What's a CI service? · Automated Testing

© 2026 Coveralls, Inc