*/ class Account extends \Espo\Core\Repositories\Database { public function afterSave(Entity $entity, array $options = []) { parent::afterSave($entity, $options); if ($entity->has('targetListId')) { $this->relate($entity, 'targetLists', $entity->get('targetListId')); } } }