eZ\Publish\Core\FieldType\Page\PageService::getAvailableZoneLayouts PHP Method

getAvailableZoneLayouts() public method

Returns list of available zone layouts.
public getAvailableZoneLayouts ( ) : array
return array
    public function getAvailableZoneLayouts()
    {
        return array_keys($this->zoneDefinition);
    }

Usage Example

Example #1
0
 /**
  * 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;
 }
All Usage Examples Of eZ\Publish\Core\FieldType\Page\PageService::getAvailableZoneLayouts