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

CPS-IT / personio-jobs / 15388375997

02 Jun 2025 09:09AM UTC coverage: 3.654% (+0.04%) from 3.61%
15388375997

push

github

web-flow
Merge pull request #228 from CPS-IT/task/drop-v11

[!!!][TASK] Drop support for TYPO3 v11.5

0 of 8 new or added lines in 5 files covered. (0.0%)

6 existing lines in 5 files now uncovered.

27 of 739 relevant lines covered (3.65%)

0.16 hits per line

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

0.0
/Classes/Domain/Repository/JobRepository.php
1
<?php
2

3
declare(strict_types=1);
4

5
/*
6
 * This file is part of the TYPO3 CMS extension "personio_jobs".
7
 *
8
 * Copyright (C) 2023 Elias Häußler <e.haeussler@familie-redlich.de>
9
 *
10
 * This program is free software: you can redistribute it and/or modify
11
 * it under the terms of the GNU General Public License as published by
12
 * the Free Software Foundation, either version 2 of the License, or
13
 * (at your option) any later version.
14
 *
15
 * This program is distributed in the hope that it will be useful,
16
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18
 * GNU General Public License for more details.
19
 *
20
 * You should have received a copy of the GNU General Public License
21
 * along with this program. If not, see <https://www.gnu.org/licenses/>.
22
 */
23

24
namespace CPSIT\Typo3PersonioJobs\Domain\Repository;
25

26
use CPSIT\Typo3PersonioJobs\Domain\Model\Dto\Demand;
27
use CPSIT\Typo3PersonioJobs\Domain\Model\Job;
28
use TYPO3\CMS\Extbase\Persistence\QueryResultInterface;
29
use TYPO3\CMS\Extbase\Persistence\Repository;
30

31
/**
32
 * JobRepository
33
 *
34
 * @author Elias Häußler <e.haeussler@familie-redlich.de>
35
 * @license GPL-2.0-or-later
36
 *
37
 * @extends Repository<Job>
38
 */
39
class JobRepository extends Repository
40
{
41
    /**
42
     * @return QueryResultInterface<Job>
43
     */
44
    public function findByDemand(Demand $demand): QueryResultInterface
×
45
    {
46
        $query = $this->createQuery();
×
47
        $demand->apply($query);
×
48

49
        return $query->execute();
×
50
    }
51

NEW
52
    public function findOneByPersonioId(int $personioId, ?int $storagePid = null): ?Job
×
53
    {
54
        $query = $this->createQuery();
×
55

56
        if ($storagePid !== null) {
×
57
            $query->getQuerySettings()->setStoragePageIds([$storagePid]);
×
58
        }
59

60
        $query->matching($query->equals('personioId', $personioId));
×
61
        $query->setLimit(1);
×
62

63
        return $query->execute()->getFirst();
×
64
    }
65

66
    public function findOneByJobDescription(int $jobDescription): ?Job
×
67
    {
68
        $query = $this->createQuery();
×
69
        $query->matching($query->contains('jobDescriptions', $jobDescription));
×
70
        $query->setLimit(1);
×
71

72
        return $query->execute()->getFirst();
×
73
    }
74

75
    /**
76
     * @param list<Job> $existingJobs
77
     * @return QueryResultInterface<Job>
78
     */
NEW
79
    public function findOrphans(array $existingJobs, ?int $storagePid = null): QueryResultInterface
×
80
    {
81
        $query = $this->createQuery();
×
82

83
        if ($storagePid !== null) {
×
84
            $query->getQuerySettings()->setStoragePageIds([$storagePid]);
×
85
        }
86

87
        if ($existingJobs !== []) {
×
88
            $query->matching(
×
89
                $query->logicalNot(
×
90
                    $query->in(
×
91
                        'personioId',
×
92
                        array_map(static fn(Job $job) => $job->getPersonioId(), $existingJobs),
×
93
                    ),
×
94
                ),
×
95
            );
×
96
        }
97

98
        return $query->execute();
×
99
    }
100
}
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