Support for Drupal 7 is ending on 5 January 2025—it’s time to migrate to Drupal 10! Learn about the many benefits of Drupal 10 and find migration tools in our resource center.
Hi, I have created many entity types, bundles with ECK UI. All fine.
I have a case of an entity type with no field but 3 bundles. I added properties to this entity type. What do I need to do to access the value of the custom properties (say custom_property) I added to this entity type?
Three days I am looking for a solution... any help welcome.
I can get the entity I want, load it, and with print_r($entity) view the value I desire, but how to access?
Comments
Comment #1
fmizzell CreditAttribution: fmizzell commentedcustom properties are simple public properties in the entity object, so you can access a custom property like any other property:
$entity->custom_property
So print_r($entity->custom_property); should show you just the value that you want.
Does that answer your question?
Comment #2
DamienMcKenna@zini81: you don't need to assign the issue to yourself :)
Marking as "maintainer needs more info" as zini81 hasn't responded yet.
Comment #3
legolasboClosing old issues. Please reopen the issue with a clear description and/or steps to reproduce if this issue is still relevant.
Comment #4
legolasbo