public static function patch($pairs = null, $terms = null)
    {
        $self = self::newSelf();

        if (!$self->table()) {
            return false;
        }

        if (!empty($self->attributes) && null === $terms) {
            $terms = $self->attributes;
        }

        if (empty($pairs)) {
            throw new \LogicException('Could not update empty data');
        }

        if ($self->timestamps) {
            $pairs[self::UPDATED] = $self->freshDate();
        }

        $query = $self->update($pairs);

        $self->normalizeTerms($query, $terms);

        if ($result = $query->execute()) {
            $self->attributes = array_merge($self->attributes, $pairs);

            return $result;
        }

        return 0;
    }