1: <?php
2:
3: namespace Charcoal\Cms\Section;
4:
5: // From 'charcoal-cms'
6: use Charcoal\Cms\AbstractSection;
7:
8: // Parent namespace dependencies
9: use Charcoal\Cms\Mixin\BlocksSectionInterface;
10: use Charcoal\Cms\Mixin\Traits\BlocksSectionTrait;
11:
12: // dependencies from `charcoal-core`
13: use Charcoal\Loader\CollectionLoader;
14:
15: // dependencies from `pimple`
16: use Pimple\Container;
17:
18: // dependencies from Psr-7
19: use \RuntimeException;
20:
21: /**
22: * Blocks-content section
23: */
24: class BlocksSection extends AbstractSection implements
25: BlocksSectionInterface
26: {
27: use BlocksSectionTrait;
28: /**
29: * @var Collection $blocks
30: */
31: private $blocks;
32:
33: /**
34: * Overrides `AbstractSection::section_type()`
35: *
36: * @return string
37: */
38: public function sectionType()
39: {
40: return AbstractSection::TYPE_BLOCKS;
41: }
42:
43: /**
44: * @return Collection List of `Block` objects
45: */
46: public function blocks()
47: {
48: if ($this->blocks === null) {
49: $this->blocks = $this->loadBlocks();
50: }
51: return $this->blocks;
52: }
53:
54: /**
55: * @return Collection
56: */
57: public function loadBlocks()
58: {
59: // @todo
60: return [];
61: }
62: }
63: