/** * Setup the property's display value before its assigned to the object row. * * This method is useful for classes using this trait. * * @param ModelInterface $object The current row's object. * @param PropertyInterface $property The current property. * @return void */ protected function setupDisplayPropertyValue(ModelInterface $object, PropertyInterface $property) { $displayType = $property->displayType(); $this->display = $this->propertyDisplayFactory()->create($displayType); $this->display->setDisplayType($displayType); $this->display->setProperty($property); $metadata = $property->metadata(); $objMetadata = $object->metadata()->property($property->ident()); if ($objMetadata) { $metadata->setData($objMetadata); } $this->display->setData($metadata); $this->display->setData($property->viewOptions($displayType)); }