public function makeFieldReadonly($field)
    {
        $fieldName = ($field instanceof FormField) ? $field->getName() : $field;

        // Iterate on items, looking for the applicable field
        foreach ($this->children as $i => $item) {
            if ($item instanceof CompositeField) {
                if ($item->makeFieldReadonly($fieldName)) {
                    return true;
                };
            } elseif ($item instanceof FormField && $item->getName() == $fieldName) {
                // Once it's found, use FormField::transform to turn the field into a readonly version of itself.
                $this->children->replaceField($fieldName, $item->transform(new ReadonlyTransformation()));

                // A true results indicates that the field was found
                return true;
            }
        }
        return false;
    }