Passed
Push — release-11.5.x ( 1b5a31...ef0664 )
by Markus
31:41
created

AbstractRecordMovedEvent::getPreviousParentId()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 3
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Code Coverage

Tests 2
CRAP Score 1

Importance

Changes 1
Bugs 0 Features 0
Metric Value
eloc 1
c 1
b 0
f 0
dl 0
loc 3
ccs 2
cts 2
cp 1
rs 10
cc 1
nc 1
nop 0
crap 1
1
<?php
2
3
declare(strict_types=1);
4
5
/*
6
 * This file is part of the TYPO3 CMS project.
7
 *
8
 * It is free software; you can redistribute it and/or modify it under
9
 * the terms of the GNU General Public License, either version 2
10
 * of the License, or any later version.
11
 *
12
 * For the full copyright and license information, please read the
13
 * LICENSE.txt file that was distributed with this source code.
14
 *
15
 * The TYPO3 project - inspiring people to share!
16
 */
17
18
namespace ApacheSolrForTypo3\Solr\Domain\Index\Queue\UpdateHandler\Events;
19
20
/**
21
 * Abstract event base for events fired if a record or page is moved
22
 */
23
abstract class AbstractRecordMovedEvent extends AbstractDataUpdateEvent
24
{
25
    /**
26
     * pid of the record prior moving
27
     *
28
     * @var int|null
29
     */
30
    protected ?int $previousParentId = null;
31
32
    /**
33
     * Sets the record's pid prior moving
34
     *
35
     * @param int $pid
36
     */
37 6
    public function setPreviousParentId(int $pid)
38
    {
39 6
        $this->previousParentId = $pid;
40
    }
41
42
    /**
43
     * Returns the record's pid prior moving
44
     *
45
     * @return int|null
46
     */
47 10
    public function getPreviousParentId(): ?int
48
    {
49 10
        return $this->previousParentId;
50
    }
51
}
52