public function prepareOptions($name, $options, $loadRelationships = true)
    {
        //set the options array to the format we need
        $options = $this->validateOptions($name, $options);

        //make sure the 'title' option is set
        $options['title'] = isset($options['title']) ? $options['title'] : $options['field_name'];
        $options['hint'] = isset($options['hint']) ? $options['hint'] : '';

        //ensure the type is set and then check that the field type exists
        $this->ensureTypeIsSet($options);

        //set the proper relationship options
        $this->setRelationshipType($options, $loadRelationships);

        //check that the type is a valid field class
        $this->checkTypeExists($options);

        return $options;
    }