Code Coverage |
||||||||||
Lines |
Functions and Methods |
Classes and Traits |
||||||||
Total | |
0.00% |
0 / 5 |
|
0.00% |
0 / 3 |
CRAP | |
0.00% |
0 / 1 |
AbstractSummary | |
0.00% |
0 / 5 |
|
0.00% |
0 / 3 |
12 | |
0.00% |
0 / 1 |
fromStorageRow | |
0.00% |
0 / 3 |
|
0.00% |
0 / 1 |
2 | |||
getSummaryTargetId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 | |||
getCollectionId | |
0.00% |
0 / 1 |
|
0.00% |
0 / 1 |
2 |
1 | <?php |
2 | |
3 | namespace Flow\Model; |
4 | |
5 | /** |
6 | * We share uuid for different entities in some cases. If both entities happen |
7 | * to have a summary, it's not easy to distinguish them with the same rev_type |
8 | */ |
9 | abstract class AbstractSummary extends AbstractRevision { |
10 | |
11 | /** |
12 | * The id of the entity to be summarized |
13 | * @var UUID |
14 | */ |
15 | protected $summaryTargetId; |
16 | |
17 | public static function fromStorageRow( array $row, $obj = null ) { |
18 | /** @var $obj AbstractSummary */ |
19 | $obj = parent::fromStorageRow( $row, $obj ); |
20 | // @phan-suppress-next-line PhanUndeclaredProperty Type not inferred |
21 | $obj->summaryTargetId = UUID::create( $row['rev_type_id'] ); |
22 | return $obj; |
23 | } |
24 | |
25 | /** |
26 | * @return UUID |
27 | */ |
28 | public function getSummaryTargetId() { |
29 | return $this->summaryTargetId; |
30 | } |
31 | |
32 | /** |
33 | * @return UUID |
34 | */ |
35 | public function getCollectionId() { |
36 | return $this->getSummaryTargetId(); |
37 | } |
38 | |
39 | } |