NerdsAndCompany\Schematic\Services\TagGroups::export PHP Метод

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

Export taggroups.
public export ( array $tagGroups = [] ) : array
$tagGroups array
Результат array
    public function export(array $tagGroups = [])
    {
        Craft::log(Craft::t('Exporting TagGroups'));
        $tagGroupDefinitions = [];
        foreach ($tagGroups as $tagGroup) {
            $tagGroupDefinitions[$tagGroup->handle] = $this->getTagGroupDefinition($tagGroup);
        }
        return $tagGroupDefinitions;
    }

Usage Example

Пример #1
0
 /**
  * @covers ::export
  * @dataProvider provideValidTagGroups
  *
  * @param TagGroupModel[] $groups
  * @param array           $expectedResult
  */
 public function testSuccessfulExport(array $groups, array $expectedResult = [])
 {
     $this->setMockFieldsService();
     $this->setMockSchematicFields();
     $schematicTagGroupsService = new TagGroups();
     $actualResult = $schematicTagGroupsService->export($groups);
     $this->assertSame($expectedResult, $actualResult);
 }