public function add(EntityAdded $event)
    {
        $entity = $event->getEntity();
        $collection = $event->getCollection();
        $this->deleteRelation($entity, $collection);

        $repository = $this->getParentRepository();
        $adapter = $repository->getAdapter();
        $value = $collection->parentEntity()->getId();

        Sql::createSql($adapter)
            ->insert($this->getRelationTable())
            ->set(
                [
                    "{$this->getRelatedForeignKey()}" => $entity->getId(),
                    "{$this->getForeignKey()}" => $value
                ]
            )
            ->execute();
    }