src/Leevel/Database/Ddd/UnitOfWork.php
public function refresh(IEntity $entity): IUnitOfWork
    {
        $this->validateClosed();

        if (self::STATE_MANAGED !== $this->getEntityState($entity)) {
            $e = sprintf('Entity `%s` was not managed.', get_class($entity));

            throw new InvalidArgumentException($e);
        }

        $this->repository($entity)->refresh($entity);

        return $this;
    }
public function refresh(IEntity $entity): IUnitOfWork
    {
        $this->validateClosed();

        if (self::STATE_MANAGED !== $this->getEntityState($entity)) {
            $e = sprintf('Entity `%s` was not managed.', get_class($entity));

            throw new InvalidArgumentException($e);
        }

        $this->repository($entity)->refresh($entity);

        return $this;
    }
刷新实体.

@param \Leevel\Database\Ddd\IEntity $entity

@return $this