src/Forms/NullableField.php
public function setValue($value, $data = null)
    {
        $id = $this->getIsNullId();

        if (is_array($data) && array_key_exists($id, $data) && $data[$id]) {
            $value = null;
        }

        $this->valueField->setValue($value);

        parent::setValue($value);

        return $this;
    }
public function setValue($value, $data = null)
    {
        $id = $this->getIsNullId();

        if (is_array($data) && array_key_exists($id, $data) && $data[$id]) {
            $value = null;
        }

        $this->valueField->setValue($value);

        parent::setValue($value);

        return $this;
    }
public function setValue ( $ value , $ data = null ) { $ id = $ this -> getIsNullId ( ) ; if ( is_array ( $ data ) && array_key_exists ( $ id , $ data ) && $ data [ $ id ] ) { $ value = null ; } $ this -> valueField -> setValue ( $ value ) ; parent :: setValue ( $ value ) ; return $ this ; }
Value is sometimes an array, and sometimes a single value, so we need to handle both cases

@param mixed $value
@param null|array $data

@return $this
Value is sometimes an array and sometimes a single value so we need to handle both cases