public function setJoinData(Table $table, EntityInterface $entity) : self
    {
        $entityClass = $table->getEntityClass();
        if (! $entity instanceof $entityClass) {
            throw new InvalidArgumentException(sprintf(
                'Entity must be an instance of "%s". Instead, instance of "%s" was provided.',
                $table->getEntityClass(),
                get_class($entity)
            ));
        }

        $this->joinTable = $table;
        $this->entity = $entity;

        return $this;
    }