The documentation for `hook_inline_entity_email_address_fields_alter` says you can use `type` as either `property` or `field` or `callback`. I've done the following:
function xrm_core_inline_entity_form_table_fields_alter(&$fields, $context){
$fields['summary'] = array(
'type' => 'property',
'label' => t('Email'),
'weight' => 1,
);
}
The `summary` property is defined as follows in my Entity
public $summary;
public function __construct(array $values, $entity_type, $is_bundle = FALSE,
$translations = array()) {
parent::__construct($values, $entity_type, $is_bundle, $translations);
$this->summary = "" . $this->get('address')->value . " \n"
. "(" . "visibility | " . $this->get('visibility')->value . ")";
dpm('summary: ' . $this->summary);
}
The dpm correctly prints out the values, but the `summary` column is empty in inline entity form table. What am I doing wrong here?
Comments
I found the hook_entity
I found the hook_entity_property_info() for defining entity properties. Seems like that's only possible for schema fields though. Not sure how to make a property return an expression like the one in my question. Thanks for all those who read my question.
Please feel free to supply a better answer. Regards