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

fmizzell’s picture

custom 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?

DamienMcKenna’s picture

Version: 7.x-2.0-rc2 » 7.x-2.x-dev
Assigned: zini81 » Unassigned
Status: Active » Postponed (maintainer needs more info)

@zini81: you don't need to assign the issue to yourself :)

Marking as "maintainer needs more info" as zini81 hasn't responded yet.

legolasbo’s picture

Status: Postponed (maintainer needs more info) » Closed (duplicate)

Closing old issues. Please reopen the issue with a clear description and/or steps to reproduce if this issue is still relevant.

legolasbo’s picture

Status: Closed (duplicate) » Closed (cannot reproduce)