protected function setFieldValue($key, $data, $default = null)
    {
        $value = null;

        if (isset($data->$key)) {
            $value = $data->$key;
        }

        if ($value === null) {
            $value = $default;
        }

        return $value;
    }
protected function setFieldValue($key, $data, $default = null)
    {
        $value = null;

        if (isset($data->$key)) {
            $value = $data->$key;
        }

        if ($value === null) {
            $value = $default;
        }

        return $value;
    }
protected function setFieldValue ( $ key , $ data , $ default = null ) { $ value = null ; if ( isset ( $ data -> $ key ) ) { $ value = $ data -> $ key ; } if ( $ value === null ) { $ value = $ default ; } return $ value ; }
Set Value for Field

@param   string     $key
@param   object     $data
@param   null|mixed $default

@return  stdClass
@since   1.0.0
Set Value for Field