private function valueToWidget(ModelInterface $model, PropertyInterface $property)
    {
        $environment = $this->getEnvironment();

        $event = new DecodePropertyValueForWidgetEvent($environment, $model);
        $event
            ->setProperty($property->getName())
            ->setValue($model->getProperty($property->getName()));

        $environment->getEventDispatcher()->dispatch($event::NAME, $event);
        $value = $event->getValue();

        $propExtra = $property->getExtra();

        if ((0 === (int) $value)
            && \is_numeric($value)
            && empty($propExtra['mandatory'])
            && (isset($propExtra['rgxp']) && \in_array($propExtra['rgxp'], ['date', 'time', 'datim']))
        ) {
            $value = '';
        }

        return $value;
    }