This topic contains 6 replies, has 2 voices, and was last updated by andytnumiko 7 years, 10 months ago.
- Topic
Hi,
I’m trying to associate a custom entity with a custom activity. I’m following the example here https://github.com/orocrm/platform/blob/master/src/Oro/Bundle/ActivityBundle/README.md but when I run the migration I get:
“[LogicException]
A new model can be created for custom entity only. Class: [entity]”(where [entity] is the entity I’m trying to associate with the activity)
My migration code is (naming changed for confidentiality):
namespace...class CAEntityBundle implements Migration, ActivityExtensionAwareInterface
{
/** @var ActivityExtension */
protected $activityExtension;/**
* {@inheritdoc}
*/
public function setActivityExtension(ActivityExtension $activityExtension)
{
$this->activityExtension = $activityExtension;
}/**
* {@inheritdoc}
*/
public function up(Schema $schema, QueryBag $queries)
{
self::addActivityAssociations($schema, $this->activityExtension);
}/**
* Enables Email activity for User entity
*
* @param Schema $schema
* @param ActivityExtension $activityExtension
*/
public static function addActivityAssociations(Schema $schema, ActivityExtension $activityExtension)
{
$activityExtension->addActivityAssociation($schema, 'ca_activity', 'ca_entity', true);
}
}
I’m not sure what constitutes a “custom entity” given that we created the entity?
Thanks for you help.
Andy
The forum ‘OroPlatform – How do I? Questions’ is closed to new topics and replies.