protected function parseValue(FieldBuilder $field, $value = null)
    {
        $parsedValue = null;

        // No data found, define a default by field type.
        switch ($field->getFieldType())
        {

            case 'checkbox':
            case 'checkboxes': // @todo remove this checkboxes statement for next major update.
            case 'radio':
            case 'select':
            case 'collection':

                $parsedValue = $this->parseArrayable($field, $value);
                break;

            case 'infinite':

                // Check for the registered fields and their default value if one.
                $parsedValue = $this->parseInfinite($field, $value);
                break;

            // Text
            // Textarea
            // Password
            // Media
            // Editor
            default:
                $parsedValue = $this->parseString($field, $value);
        }

        return $parsedValue;
    }
protected function parseValue(FieldBuilder $field, $value = null)
    {
        $parsedValue = null;

        // No data found, define a default by field type.
        switch ($field->getFieldType())
        {

            case 'checkbox':
            case 'checkboxes': // @todo remove this checkboxes statement for next major update.
            case 'radio':
            case 'select':
            case 'collection':

                $parsedValue = $this->parseArrayable($field, $value);
                break;

            case 'infinite':

                // Check for the registered fields and their default value if one.
                $parsedValue = $this->parseInfinite($field, $value);
                break;

            // Text
            // Textarea
            // Password
            // Media
            // Editor
            default:
                $parsedValue = $this->parseString($field, $value);
        }

        return $parsedValue;
    }
protected function parseValue ( FieldBuilder $ field , $ value = null ) { $ parsedValue = null ; // No data found, define a default by field type. switch ( $ field -> getFieldType ( ) ) { case 'checkbox' : case 'checkboxes' : // @todo remove this checkboxes statement for next major update. case 'radio' : case 'select' : case 'collection' : $ parsedValue = $ this -> parseArrayable ( $ field , $ value ) ; break ; case 'infinite' : // Check for the registered fields and their default value if one. $ parsedValue = $ this -> parseInfinite ( $ field , $ value ) ; break ; // Text // Textarea // Password // Media // Editor default : $ parsedValue = $ this -> parseString ( $ field , $ value ) ; } return $ parsedValue ; }
Set a default value for a given field.

@param FieldBuilder $field A field instance.
@param mixed        $value A registered value.

@return mixed
Set a default value for a given field .