- Issue created by @eameyers
Hi i know this is probably not the right place but I am looking for some help with the group Module. I am using the entity clone module to clone groups and i have gotten it so far that members are cloned with the group but the content is not cloned with it so i am currently trying to do that and have come across the addRelationship() function but that needs a plugin ID and that is where I am lost. I can not get the correct plugin ID. Here the function
public function myPreClone(EntityCloneEvent $event): void {
$original = $event->getEntity();
$newEntity = $event->getClonedEntity();
$relationships = $original->getRelatedEntities();
foreach ($relationships as $relationship) {
$newEntity->save();
$newEntity->addRelationship($relationship, $relationship->getPluginID(), $values = []);
$newEntity->save();
}
}
Can someone help or tell me where i can ask for help?
Try to programmtically add a relationship to a group.
Active
3.1
Code