eZ\Publish\Core\FieldType\Page\HashConverter::convertBlockToHash PHP Метод

convertBlockToHash() защищенный Метод

Converts the given $block into a plain hash format.
protected convertBlockToHash ( Block $block ) : array
$block eZ\Publish\Core\FieldType\Page\Parts\Block
Результат array
    protected function convertBlockToHash(Block $block)
    {
        $hash = array();
        foreach ($block->getState() as $propName => $propValue) {
            switch ($propName) {
                case 'id':
                case 'name':
                case 'type':
                case 'view':
                case 'overflowId':
                case 'customAttributes':
                case 'action':
                case 'rotation':
                case 'zoneId':
                    if ($propValue !== null) {
                        $hash[$propName] = $propValue;
                    }
                    break;
                case 'attributes':
                    if ($propValue !== null && $propValue !== array()) {
                        $hash['attributes'] = $propValue;
                    }
                    break;
                case 'items':
                    foreach ($propValue as $item) {
                        $hash['items'][] = $this->convertItemToHash($item);
                    }
                    break;
            }
        }
        return $hash;
    }