I’ve a custom content entity entity
and in this entity I added a custom field type myfield
. This field is multi-value and multiple input fields and is hidden in content entity form and need to be updated during certain operation.
In the method to update the field inside enity
class as follows
public function setMyField(Object xyz){
// some operations.
$values['a'] = 'a';
$values['b'] = 10;
$this->myfield[] = $values; // approach 1
$this->set('myfield',$values); // approach 2
}
I’m trying 2 different ways to save field values to db, but it is not saving anything to db.