Returns list of available zone layouts.
public getAvailableZoneLayouts ( ) : array | ||
Résultat | array |
/** * Validates the fieldSettings of a FieldDefinitionCreateStruct or FieldDefinitionUpdateStruct. * * @param mixed $fieldSettings * * @return \eZ\Publish\SPI\FieldType\ValidationError[] */ public function validateFieldSettings($fieldSettings) { $validationErrors = array(); foreach ($fieldSettings as $name => $value) { if (isset($this->settingsSchema[$name])) { switch ($name) { case 'defaultLayout': if ($value !== '' && !in_array($value, $this->pageService->getAvailableZoneLayouts())) { $validationErrors[] = new ValidationError("Layout '{$value}' for setting '%setting%' is not available", null, array('setting' => $name), "[{$name}]"); } break; } } else { $validationErrors[] = new ValidationError("Setting '%setting%' is unknown", null, array('setting' => $name), "[{$name}]"); } } return $validationErrors; }
/** * @covers eZ\Publish\Core\FieldType\Page\PageService::getAvailableZoneLayouts */ public function testGetAvailableZoneLayouts() { $this->assertSame(array_keys($this->zoneDefinition), $this->pageService->getAvailableZoneLayouts()); }