V
V
vladislav9972021-09-07 12:00:44
symfony
vladislav997, 2021-09-07 12:00:44

Why is null value not written, while nullable=true in essence?

Tell me what could be the problem: there is a Section entity, it has the following code:

/**
     * @ORM\Column(type="string", length=255, nullable=true)
     */
    private $sending_type;


in the shape of:
->add('sending_type', \Symfony\Component\Form\Extension\Core\Type\IntegerType::class, [
                'required' => false
            ])


And the error when submitting the form:
Expected argument of type "string", "null" given at property path "sending_type".

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question