Field.php
1 week ago
FieldInterface.php
1 week ago
Fields.php
1 week ago
FieldsInterface.php
1 week ago
Integrator.php
1 week ago
IntegratorIntegration.php
1 week ago
IntegratorInterface.php
1 week ago
Section.php
1 week ago
SectionInterface.php
1 week ago
Sections.php
1 week ago
SectionsInterface.php
1 week ago
Value.php
1 week ago
ValueInterface.php
1 week ago
Sections.php
40 lines
| 1 | <?php |
| 2 | |
| 3 | namespace WPDesk\FCF\Free\Integration; |
| 4 | |
| 5 | /** |
| 6 | * . |
| 7 | */ |
| 8 | class Sections implements SectionsInterface { |
| 9 | |
| 10 | /** |
| 11 | * List of field sections. |
| 12 | * |
| 13 | * @var array |
| 14 | */ |
| 15 | private $field_sections; |
| 16 | |
| 17 | /** |
| 18 | * Class constructor. |
| 19 | * |
| 20 | * @param array $field_sections List of field sections. |
| 21 | */ |
| 22 | public function __construct( array $field_sections ) { |
| 23 | $this->field_sections = $field_sections; |
| 24 | } |
| 25 | |
| 26 | /** |
| 27 | * Returns list of available field sections. |
| 28 | * |
| 29 | * @return SectionInterface[] List of objects with section data. |
| 30 | */ |
| 31 | public function get_available_field_sections(): array { |
| 32 | $items = []; |
| 33 | foreach ( $this->field_sections as $section ) { |
| 34 | $items[] = new Section( $section ); |
| 35 | } |
| 36 | |
| 37 | return $items; |
| 38 | } |
| 39 | } |
| 40 |