Conditions | 7 |
Paths | 6 |
Total Lines | 18 |
Code Lines | 10 |
Lines | 0 |
Ratio | 0 % |
Changes | 1 | ||
Bugs | 0 | Features | 0 |
1 | <?php |
||
40 | public function getWebViewChildren($excludeUnpublished = false) |
||
41 | { |
||
42 | $webViewChildren = []; |
||
43 | foreach ($this->children as $child) { |
||
44 | if (!$child instanceof BusinessTemplate) { |
||
45 | $notPublished = $child->getStatus() != PageStatus::PUBLISHED; |
||
46 | $scheduledDateNotReached = $child->getStatus() == PageStatus::SCHEDULED && $child->getPublishedAt() > new \DateTime(); |
||
47 | |||
48 | if ($excludeUnpublished && ($notPublished || $scheduledDateNotReached)) { |
||
49 | continue; |
||
50 | } |
||
51 | |||
52 | $webViewChildren[] = $child; |
||
53 | } |
||
54 | } |
||
55 | |||
56 | return $webViewChildren; |
||
57 | } |
||
58 | } |
||
59 |