Hoping this is a quick and easy reply for someone. I am creating a package that builds express entities and associations between them. When creating the express entity’s form, I can’t for the life of me figure out how to add an association key.
Not a direct answer to your question but I’m wondering if you might be better served going a different route.
Why not create the entities, the forms and everything you need from the dashboard then use the Concrete migration tool to export it all as XML and finally use the core importer from your package to install it wherever you want.
Thanks for the reply but I have no idea what that all means I pretty much follow the tutorials and embellish from there. Which is sometimes difficult. For example, I used this to find how to create the entities and how to create the associations
but I wish it was a consistent example. In other words, not switch from the boats/marinas example to a worker/skill example, a little students/teachers and back to the boats/marinas.
This is always a great reference but often lacks certain details.
There is a great list of how to add express attributes and their options but nothing about how to set the options for the associations. And nothing about adding key controls to an express form (or their options).
Concrete has a migration tool that is helpful when migrating from one version to another, but also when simply migrating data from one site to another.
It lets you select what you want to migrate, like users, pages, attributes…. And Express Entities as well as Entries.
You can decide to migrate existing Express entries. The migration tool will then generate an XML file that contains all the information to recreate your Express entity.
So, say you create your entity from the dashboard, you then export it as an XML file, you add that file to your package, add 1 line of code to your package’s install routine, and that’s it. The Express entity will be created whenever you install the package.
So, say you add the XML called express_entities.xml in a folder called config in your package, you can add this code to your package’s controller:
public function install()
{
parent::install();
$this->installContentFile('config/express_entities.xml');
}
And that’s it.
Much easier than creating the entity programmatically.