{"id":22017991,"url":"https://github.com/gertvdb/entity_field_helper","last_synced_at":"2026-01-22T05:33:03.508Z","repository":{"id":56983075,"uuid":"152300789","full_name":"gertvdb/entity_field_helper","owner":"gertvdb","description":"Helper for getting field values from entities.","archived":false,"fork":false,"pushed_at":"2024-11-06T18:19:24.000Z","size":232,"stargazers_count":0,"open_issues_count":4,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-08-21T01:46:16.340Z","etag":null,"topics":["drupal"],"latest_commit_sha":null,"homepage":"","language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/gertvdb.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null,"zenodo":null}},"created_at":"2018-10-09T18:25:48.000Z","updated_at":"2022-05-06T20:19:58.000Z","dependencies_parsed_at":"2025-05-07T03:10:32.745Z","dependency_job_id":"38cf5fe5-b435-4043-9228-fd172c19939e","html_url":"https://github.com/gertvdb/entity_field_helper","commit_stats":null,"previous_names":[],"tags_count":6,"template":false,"template_full_name":null,"purl":"pkg:github/gertvdb/entity_field_helper","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gertvdb%2Fentity_field_helper","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gertvdb%2Fentity_field_helper/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gertvdb%2Fentity_field_helper/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gertvdb%2Fentity_field_helper/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/gertvdb","download_url":"https://codeload.github.com/gertvdb/entity_field_helper/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/gertvdb%2Fentity_field_helper/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28656277,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2026-01-22T01:17:37.254Z","status":"online","status_checked_at":"2026-01-22T02:00:07.137Z","response_time":144,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["drupal"],"created_at":"2024-11-30T05:09:13.872Z","updated_at":"2026-01-22T05:33:03.494Z","avatar_url":"https://github.com/gertvdb.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Entity Field Helper\n\n[![GitHub license](https://img.shields.io/badge/license-MIT-blue.svg)](https://github.com/gertvdb/entity_field_helper/blob/8.x-1.x/LICENSE.md)\n[![Travis](https://img.shields.io/travis/gertvdb/entity_field_helper.svg)](https://travis-ci.org/gertvdb/entity_field_helper) \n[![Coverage Status](https://coveralls.io/repos/github/gertvdb/entity_field_helper/badge.svg?branch=8.x-1.x)](https://coveralls.io/github/gertvdb/entity_field_helper?branch=8.x-1.x)\n[![Packagist](https://img.shields.io/packagist/v/gertvdb/entity_field_helper.svg)](https://packagist.org/packages/gertvdb/entity_field_helper)\n\nDescription\n-----------\nThis module provides a helper class for getting values from entities.\nThe main principle of the module is that the value functions will always \nreturn NULL or the actual value when found. This makes it easy to handle\nprinting and sending data to the templates. \n\nInstallation\n------------\nTo install this module, do the following:\n\nWith composer:\n1. ```composer require gertvdb/entity_field_helper```\n\nExamples\n--------\nYou can find an example on how to use the entity field helper below. \nThe entity field helper classes are plugins so other modules can provide\nextra helpers.  \n\n#### Getting a Known helper (Provided by module).\nThe entity field helper provides several plugin for most of the \nfield types in Drupal Core. The plugin manager contains shortcuts to get\nthose helpers.\n\n##### Basic.\n\n``` \n  /** @var \\Drupal\\entity_field_helper\\Plugin\\EntityFieldHelperManager $pluginManager */\n  $pluginManager = \\Drupal::service('plugin.manager.entity_field_helper');\n  \n  // Get the node object.\n  $node = Node::load(1);\n  \n  $processedTextHelper = $pluginManager-\u003eprocessedTextHelper();\n  $processedTextHelper-\u003egetValue($node, 'body');\n  \n```\n##### Advanced.\n\n``` \n  /** @var \\Drupal\\entity_field_helper\\Plugin\\EntityFieldHelperManager $pluginManager */\n  $pluginManager = \\Drupal::service('plugin.manager.entity_field_helper');\n  \n  // Get the node object.\n  $node = Node::load(1);\n  \n  $imageHelper = $pluginManager-\u003eimageHelper();\n  $visuals = $imageHelper-\u003egetValues($node, 'field_visuals');\n  \n  $images = [];\n  $imageStyle = ImageStyle::load('slider');\n  \n  foreach ($visuals as $visual) {\n      $image = $imageHelper-\u003egetImage($visual);\n      $imageWidth = $image-\u003egetWidth();\n      if ($imageWidth \u003e 1000) {\n        $images[] = $imageHelper-\u003egetImageStyleUrl($visual, $imageStyle);\n      }\n  }\n  \n```\n\n##### Custom helper.\n\n``` \nnamespace Drupal\\entity_field_helper\\Plugin\\EntityFieldHelper;\n\nuse Drupal\\entity_field_helper\\Plugin\\EntityFieldHelperBase;\n\n/**\n * Provides a General Entity Field Helper.\n *\n * @EntityFieldHelper(\n *   id = \"my_custom_helper\",\n *   name = \"My Custom Helper\",\n * )\n */\nfinal class MyCustomHelper extends EntityFieldHelperBase {}\n``` \n\n``` \n  /** @var \\Drupal\\entity_field_helper\\Plugin\\EntityFieldHelperManager $pluginManager */\n  $pluginManager = \\Drupal::service('plugin.manager.entity_field_helper');\n  \n  $myCustomHelper = $pluginManager-\u003ecreateInstance('my_custom_helper');\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgertvdb%2Fentity_field_helper","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fgertvdb%2Fentity_field_helper","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fgertvdb%2Fentity_field_helper/lists"}