How to get the value of Attributes of a Class?

$myObj = DataObject\AbstractObject::getById($id);
foreach ($myObj->getClass()->getFieldDefinitions() as $fieldDefinition) {
array_push($data, $fieldDefinition->getTitle());
}
i can get the Title of the attributes but how do i get the values set to those attributes??

$object = DataObject::getById(235);
$object->setName("Name"); //setter field
$object->save();

See here https://pimcore.com/docs/6.x/Development_Documentation/Objects/Working_with_PHP_API.html

1 Like