Completed
Push — master ( 33ee7a...35da7e )
by Gabriel
565:17 queued 500:16
created

BucketLog::getDate()   A

Complexity

Conditions 1
Paths 1

Size

Total Lines 2
Code Lines 1

Duplication

Lines 0
Ratio 0 %

Importance

Changes 1
Bugs 0 Features 0
Metric Value
cc 1
eloc 1
c 1
b 0
f 0
nc 1
nop 0
dl 0
loc 2
rs 10
1
<?php
2
3
declare( strict_types = 1 );
4
5
namespace WMDE\Fundraising\Frontend\BucketTesting\Domain\Model;
6
7
use DateTime;
8
use DateTimeInterface;
9
use Doctrine\Common\Collections\ArrayCollection;
10
use Doctrine\Common\Collections\Collection;
11
12
class BucketLog {
13
14
	private int $id;
15
	private int $externalId;
16
	private string $eventName;
17
	private Collection $buckets;
18
	private DateTimeInterface $date;
19
20
	public function __construct( int $externalId, string $eventName ) {
21
		$this->externalId = $externalId;
22
		$this->eventName = $eventName;
23
		$this->buckets = new ArrayCollection();
24
		$this->date = new DateTime();
25
	}
26
27
	public function getId(): int {
28
		return $this->id;
29
	}
30
31
	public function getExternalId(): int {
32
		return $this->externalId;
33
	}
34
35
	public function getDate(): DateTimeInterface {
36
		return $this->date;
37
	}
38
39
	public function getEventName(): ?string {
40
		return $this->eventName;
41
	}
42
43
	/**
44
	 * This is only used in tests
45
	 *
46
	 * @return Collection
47
	 */
48
	public function getBuckets(): Collection {
49
		return $this->buckets;
50
	}
51
52
	public function addBucket( BucketLogBucket $bucket ) {
53
		$this->buckets->add( $bucket );
54
	}
55
}
56