EntityAccessLimitException::getEntityAccessLimit()   A
last analyzed

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 0
Metric Value
cc 1
eloc 1
c 0
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
3
namespace Wikibase\DataModel\Services\Lookup;
4
5
use Wikibase\DataModel\Entity\EntityId;
6
7
/**
8
 * @since 2.1
9
 *
10
 * @license GPL-2.0-or-later
11
 * @author Marius Hoch < [email protected] >
12
 * @author Jeroen De Dauw < [email protected] >
13
 */
14
class EntityAccessLimitException extends EntityLookupException {
15
	private int $entityAccessCount;
16
	private int $entityAccessLimit;
17
18
	public function __construct( EntityId $entityId, int $entityAccessCount, int $entityAccessLimit ) {
19
		parent::__construct(
20
			$entityId,
21
			'Too many entities loaded, must not load more than ' . $entityAccessLimit . ' entities.'
22
		);
23
		$this->entityAccessCount = $entityAccessCount;
24
		$this->entityAccessLimit = $entityAccessLimit;
25
	}
26
27
	public function getEntityAccessCount(): int {
28
		return $this->entityAccessCount;
29
	}
30
31
	public function getEntityAccessLimit(): int {
32
		return $this->entityAccessLimit;
33
	}
34
}
35