elbformat / field-helper-bundle
Provides helpers to extract and set structured data from and to ibexa content fields
Installs: 2 482
Dependents: 1
Suggesters: 0
Security: 0
Stars: 8
Watchers: 4
Forks: 1
Open Issues: 14
Type:symfony-bundle
Requires
- php: >=8.1
- ext-dom: *
- ibexa/oss: ^4.0
Requires (Dev)
- friendsofphp/php-cs-fixer: ^3.3
- netgen/tagsbundle: ^4.0
- phpunit/phpunit: ^9.5
- vimeo/psalm: ^4.13
- dev-main
- v2.0.0
- v1.2.2
- v1.2.1
- v1.2.0
- v1.1.0
- v1.0.1
- v1.0.0
- v0.1.0
- dev-renovate/php-8.x
- dev-renovate/docker-metadata-action-digest
- dev-renovate/docker-login-action-digest
- dev-renovate/docker-build-push-action-digest
- dev-renovate/mariadb-11.x
- dev-ibexa-4
- dev-renovate/mariadb-10.x
- dev-matrix-field-helper
- dev-renovate/netgen-tagsbundle-5.x
- dev-renovate/actions-checkout-4.x
- dev-selection-field-helper
- dev-renovate/vimeo-psalm-5.x
- dev-new-helpers
- dev-fix-dependencies-2203
- dev-renovate/ibexa-oss-4.x
- dev-renovate/ezsystems-php-8.x
- dev-matrix-field-type
This package is auto-updated.
Last update: 2024-11-22 02:40:44 UTC
README
Elbformat Field Helper Bundle for ibexa DXP
This bundle provides helpers to extract and set structured data from and to ibexa content fields.
What are "Field helpers"?
Field helpers are intended to easily and safely access fields from content objects in a typed manner. With this you can make your project safe for static code analysis without adding too much boilerplate code everywhere. Especially for importer scripts, that create content, there is an update method which helps you to track changes. With thism, you can speed up the update process by not publishing it, when no change was made at all.
Quick usage
Install bundle via composer
$ composer require elbformat/field-helper-bundle
Use like this
public function getFields(RegistryInterface $fieldHelperRegistry, Content $content) { $myText = $fieldHelperRegistry->getTextFieldHelper()->getString($content, 'text_field'); $linkObject = $fieldHelperRegistry->getLinkFieldHelper()->getLink($content, 'my_url'); $linkUrl = $linkObj->getUrl(); $linkText = $linkObj->getText(); }