Projekt

Allgemein

Profil

Herunterladen als
Herunterladen (483 Bytes) Statistiken
| Zweig: | Revision:
ec6a9500 Christian Ehringfeld
#include "existvalidator.h"
28d2f01a Christian Ehringfeld
#include "../entity.h"
#include "../entityinstancefactory.h"
ec6a9500 Christian Ehringfeld
using namespace CuteEntityManager;
ExistValidator::ExistValidator() : Validator() {
}

ErrorMsg ExistValidator::validateParam(QVariant value, Param param) const {
28d2f01a Christian Ehringfeld
Q_UNUSED(param)
QSharedPointer<Entity> entity = EntityInstanceFactory::castQVariant(value);
if (!entity || entity->getId() <= -1) {
return ErrorMsg("", "<property> is invalid.");
}
return ErrorMsg();
ec6a9500 Christian Ehringfeld
}