PHP Класс NerdsAndCompany\Schematic\Services\Sections

Sync Craft Setups.
Автор: Nerds & Company
Наследование: extends Base
Показать файл Открыть проект

Открытые методы

Метод Описание
export ( array $sections = [], array $allowedEntryTypeIds = null ) : array Export sections.
import ( array $sectionDefinitions, boolean $force = false ) : Result Attempt to import sections.

Приватные методы

Метод Описание
getEntryTypeDefinition ( Craft\EntryTypeModel $entryType ) : array Get entry type definition.
getEntryTypeDefinitions ( array $entryTypes, $allowedEntryTypeIds ) : array Get entry type definitions.
getLocaleDefinition ( Craft\SectionLocaleModel $locale ) : array Get locale definition.
getLocaleDefinitions ( array $locales ) : array Get locale definitions.
getSectionDefinition ( Craft\SectionModel $section, $allowedEntryTypeIds ) : array Get section definition.
importEntryTypes ( Craft\SectionModel $section, array $entryTypeDefinitions, boolean $force )
populateEntryType ( Craft\EntryTypeModel $entryType, array $entryTypeDefinition, string $entryTypeHandle, integer $sectionId ) Populate entry type.
populateSection ( Craft\SectionModel $section, array $sectionDefinition, string $sectionHandle ) Populate section.
populateSectionLocales ( Craft\SectionModel $section, $localeDefinitions ) Populate section locales.
preSaveSection ( Craft\SectionModel $section ) : mixed Save the section manually if it is new to prevent craft from creating the default entry type In case of a single we do want the default entry type and do a normal save Todo: This method is a bit hackish, find a better way.
resetCraftFieldsSectionModelCache ( Craft\SectionModel $section ) Reset craft section model cache using reflection.

Описание методов

export() публичный Метод

Export sections.
public export ( array $sections = [], array $allowedEntryTypeIds = null ) : array
$sections array
$allowedEntryTypeIds array
Результат array

import() публичный Метод

Attempt to import sections.
public import ( array $sectionDefinitions, boolean $force = false ) : Result
$sectionDefinitions array
$force boolean If set to true sections not included in the import will be deleted
Результат Result