I'm trying to setup a table called "FeaturedRecipe" (by extending DataObject) with the following relations:
$has_one = array (
'Image' => 'Image'
'Recipe' => 'RecipePage'
which works fine. But I now want to be able to edit that table in the CMS in a tab in a RecipeHolder page (parent page for all recipes).
I can't use a normal tablefield because they don't work with Images, so I'm trying to use a complextablefield. The problem is which type to use. This is how I understand their use:
hasmanycomplextablefield - when one RecipeHolder has many FeaturedRecipes - uses checkboxes to select which FeaturedRecipes are related
hasonecomplextablefield - when one RecipeHolder has one FeaturedRecipe - uses radio buttons to select which FeaturedRecipe is related
The problem is that neither of these fit because there is only one RecipeHolder page and it has _no_ relationship with FeaturedRecipes - I just want to be able to edit the whole (unfiltered) table within it's tabs.
So I looked at the parent class complextablefield, which I assumed required no relationship with RecipeHolder, but it keeps complaining that it can't find the parent class and that I should set it with setParentClass.
Looking at the code it seems that it's looking for a has_one relationship, but I don't see how this could work when there's no apparent way of selecting this relationship in the table (no radio buttons or checkboxes).
Can someone explain how one would use complextablefield except as a base class for the other variations?