final public static function find($id, $withTrash = false)
    {
        if ($id === null) {
            return null;
        }
        $instance = static::getRepository()
            ->find($id);
        // use this to avoid lint error in idea
        if ($instance instanceof static) {
            if ($instance->getDeletedAt() && !$withTrash) {
                return null;
            }
            return $instance;
        } else {
            return null;
        }
    }