Herunterladen als
root/samples/example/models/address.cpp @ 79bcb404
1cee0f5b | Christian Ehringfeld | #include "address.h"
|
|
af84b9c4 | Christian Ehringfeld | #include "pupil.h"
|
|
1cee0f5b | Christian Ehringfeld | ||
af84b9c4 | Christian Ehringfeld | Address::Address(QString label, QString street, QString postcode,
|
|
QString city) {
|
|||
this->label = label;
|
|||
this->street = street;
|
|||
this->postcode = postcode;
|
|||
this->city = city;
|
|||
1cee0f5b | Christian Ehringfeld | }
|
|
af84b9c4 | Christian Ehringfeld | ||
QString Address::getLabel() const {
|
|||
return label;
|
|||
1cee0f5b | Christian Ehringfeld | }
|
|
af84b9c4 | Christian Ehringfeld | void Address::setLabel(const QString &value) {
|
|
label = value;
|
|||
1cee0f5b | Christian Ehringfeld | }
|
|
af84b9c4 | Christian Ehringfeld | ||
QString Address::getStreet() const {
|
|||
return street;
|
|||
1cee0f5b | Christian Ehringfeld | }
|
|
af84b9c4 | Christian Ehringfeld | void Address::setStreet(const QString &value) {
|
|
street = value;
|
|||
1cee0f5b | Christian Ehringfeld | }
|
|
af84b9c4 | Christian Ehringfeld | ||
QString Address::getPostcode() const {
|
|||
return postcode;
|
|||
1cee0f5b | Christian Ehringfeld | }
|
|
af84b9c4 | Christian Ehringfeld | void Address::setPostcode(const QString &value) {
|
|
postcode = value;
|
|||
1cee0f5b | Christian Ehringfeld | }
|
|
af84b9c4 | Christian Ehringfeld | ||
QString Address::getCity() const {
|
|||
return city;
|
|||
1cee0f5b | Christian Ehringfeld | }
|
|
af84b9c4 | Christian Ehringfeld | void Address::setCity(const QString &value) {
|
|
city = value;
|
|||
1cee0f5b | Christian Ehringfeld | }
|
|
af84b9c4 | Christian Ehringfeld | QList<QSharedPointer<Person> > Address::getPersons() const {
|
|
return persons;
|
|||
}
|
|||
1cee0f5b | Christian Ehringfeld | ||
af84b9c4 | Christian Ehringfeld | void Address::setPersons(const QList<QSharedPointer<Person> > &value) {
|
|
persons = value;
|
|||
}
|
|||
1cee0f5b | Christian Ehringfeld | ||
af84b9c4 | Christian Ehringfeld | const QHash<QString, CuteEntityManager::Relation> Address::getRelations()
|
|
const {
|
|||
auto hash = Entity::getRelations();
|
|||
f682a8cb | Christian Ehringfeld | hash.insert("persons", CuteEntityManager::Relation("persons",
|
|
RelationType::MANY_TO_MANY,
|
|||
QString("addresses")));
|
|||
af84b9c4 | Christian Ehringfeld | hash.insert("pupils", CuteEntityManager::Relation("pupils",
|
|
RelationType::MANY_TO_MANY,
|
|||
QString("addresses")));
|
|||
return hash;
|
|||
}
|
|||
QList<QSharedPointer<Pupil> > Address::getPupils() const {
|
|||
return pupils;
|
|||
}
|
|||
void Address::setPupils(const QList<QSharedPointer<Pupil> > &value) {
|
|||
pupils = value;
|
|||
}
|
|||
1cee0f5b | Christian Ehringfeld |