Herunterladen als
root/samples/example/models/contact.cpp @ 79bcb404
1cee0f5b | Christian Ehringfeld | #include "contact.h"
|
|
af84b9c4 | Christian Ehringfeld | #include "pupil.h"
|
|
1cee0f5b | Christian Ehringfeld | ||
5c3d9487 | Christian Ehringfeld | Contact::Contact(QString label, Category category, QString content) {
|
|
3fd96253 | Christian Ehringfeld | this->label = label;
|
|
this->category = category;
|
|||
this->content = content;
|
|||
1cee0f5b | Christian Ehringfeld | }
|
|
af84b9c4 | Christian Ehringfeld | ||
const QHash<QString, CuteEntityManager::Relation> Contact::getRelations()
|
|||
const {
|
|||
auto hash = Entity::getRelations();
|
|||
f682a8cb | Christian Ehringfeld | hash.insert("persons", CuteEntityManager::Relation("persons",
|
|
RelationType::MANY_TO_MANY,
|
|||
QString("contacts")));
|
|||
af84b9c4 | Christian Ehringfeld | hash.insert("pupils", CuteEntityManager::Relation("pupils",
|
|
RelationType::MANY_TO_MANY,
|
|||
QString("contacts")));
|
|||
return hash;
|
|||
}
|
|||
3fd96253 | Christian Ehringfeld | QString Contact::getContent() const {
|
|
return content;
|
|||
}
|
|||
void Contact::setContent(const QString &value) {
|
|||
content = value;
|
|||
}
|
|||
QString Contact::getLabel() const {
|
|||
return label;
|
|||
}
|
|||
void Contact::setLabel(const QString &value) {
|
|||
label = value;
|
|||
}
|
|||
5c3d9487 | Christian Ehringfeld | Contact::Category Contact::getCategory() const {
|
|
return category;
|
|||
}
|
|||
void Contact::setCategory(const Category &value) {
|
|||
category = value;
|
|||
}
|
|||
af84b9c4 | Christian Ehringfeld | QList<QSharedPointer<Person> > Contact::getPersons() const {
|
|
return persons;
|
|||
}
|
|||
3fd96253 | Christian Ehringfeld | ||
af84b9c4 | Christian Ehringfeld | void Contact::setPersons(const QList<QSharedPointer<Person> > &value) {
|
|
persons = value;
|
|||
}
|
|||
3fd96253 | Christian Ehringfeld | ||
af84b9c4 | Christian Ehringfeld | QList<QSharedPointer<Pupil> > Contact::getPupils() const {
|
|
return pupils;
|
|||
}
|
|||
3fd96253 | Christian Ehringfeld | ||
af84b9c4 | Christian Ehringfeld | void Contact::setPupils(const QList<QSharedPointer<Pupil> > &value) {
|
|
pupils = value;
|
|||
}
|