src/Charcoal/Admin/Widget/DocWidget.php
public function setFormData(array $data)
    {
        $objData = $this->objData();
        $merged = array_replace_recursive($objData, $data);

        // Remove null values
        $merged = array_filter($merged, function ($val) {
            if ($val === null) {
                return false;
            }

            return true;
        });

        $this->formData = $merged;
        $this->obj()->setData($merged);

        return $this;
    }
public function setFormData(array $data)
    {
        $objData = $this->objData();
        $merged = array_replace_recursive($objData, $data);

        // Remove null values
        $merged = array_filter($merged, function ($val) {
            if ($val === null) {
                return false;
            }

            return true;
        });

        $this->formData = $merged;
        $this->obj()->setData($merged);

        return $this;
    }
public function setFormData ( array $ data ) { $ objData = $ this -> objData ( ) ; $ merged = array_replace_recursive ( $ objData , $ data ) ; // Remove null values $ merged = array_filter ( $ merged , function ( $ val ) { if ( $ val === null ) { return false ; } return true ; } ) ; $ this -> formData = $ merged ; $ this -> obj ( ) -> setData ( $ merged ) ; return $ this ; }
Set the form's auxiliary data.

This method is called via {@see self::setData()} if a "form_data" parameter
is present on the HTTP request.

@param array $data Data.
@return ObjectFormWidget Chainable.
Set the form s auxiliary data .