| Conditions | 5 |
| Paths | 5 |
| Total Lines | 20 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 39 | public function getTime(TournamentHierarchyInterface $entity) |
||
| 40 | { |
||
| 41 | $entityId = $entity->getId(); |
||
| 42 | if (!array_key_exists($entityId, $this->times)) { |
||
| 43 | $this->times[$entityId] = $entity->getEndTime(); |
||
| 44 | if ($this->times[$entityId] == null) { |
||
| 45 | $this->times[$entityId] = $entity->getStartTime(); |
||
| 46 | if ($this->times[$entityId] == null) { |
||
| 47 | if ($entity->getParent() !== null) { |
||
| 48 | $this->times[$entityId] = $this->getTime($entity->getParent()); |
||
| 49 | } else { |
||
| 50 | //entity must be a tournament |
||
| 51 | /** @var TournamentInterface $entity */ |
||
| 52 | $this->times[$entityId] = $entity->getUpdatedAt(); |
||
| 53 | } |
||
| 54 | } |
||
| 55 | } |
||
| 56 | } |
||
| 57 | return $this->times[$entityId]; |
||
| 58 | } |
||
| 59 | //</editor-fold desc="Public Methods"> |
||
| 60 | } |