Adds the given entity to this cache.

        :param entity: Entity to add.
        :type entity: Object implementing :class:`everest.interfaces.IEntity`.
        :raises ValueError: If the ID of the entity to add is ``None``
          (unless the `allow_none_id` constructor argument was set).

def add(self, entity):
        """
        Adds the given entity to this cache.

        :param entity: Entity to add.
        :type entity: Object implementing :class:`everest.interfaces.IEntity`.
        :raises ValueError: If the ID of the entity to add is ``None``
          (unless the `allow_none_id` constructor argument was set).
        """
        do_append = self.__check_new(entity)
        if do_append:
            self.__entities.append(entity)