Revision af84b9c4
Von Christian Ehringfeld vor fast 9 Jahren hinzugefügt
samples/example/models/address.cpp | ||
---|---|---|
#include "address.h"
|
||
#include "pupil.h"
|
||
|
||
Address::Address(QString label, QString street, QString postcode, QString city) {
|
||
m_label=label;
|
||
m_street=street;
|
||
m_postcode=postcode;
|
||
m_city=city;
|
||
Address::Address(QString label, QString street, QString postcode,
|
||
QString city) {
|
||
this->label = label;
|
||
this->street = street;
|
||
this->postcode = postcode;
|
||
this->city = city;
|
||
}
|
||
QString Address::label() const
|
||
{
|
||
return m_label;
|
||
|
||
QString Address::getLabel() const {
|
||
return label;
|
||
}
|
||
|
||
void Address::setLabel(const QString &label)
|
||
{
|
||
m_label = label;
|
||
void Address::setLabel(const QString &value) {
|
||
label = value;
|
||
}
|
||
QString Address::street() const
|
||
{
|
||
return m_street;
|
||
|
||
QString Address::getStreet() const {
|
||
return street;
|
||
}
|
||
|
||
void Address::setStreet(const QString &street)
|
||
{
|
||
m_street = street;
|
||
void Address::setStreet(const QString &value) {
|
||
street = value;
|
||
}
|
||
QString Address::postcode() const
|
||
{
|
||
return m_postcode;
|
||
|
||
QString Address::getPostcode() const {
|
||
return postcode;
|
||
}
|
||
|
||
void Address::setPostcode(const QString &postcode)
|
||
{
|
||
m_postcode = postcode;
|
||
void Address::setPostcode(const QString &value) {
|
||
postcode = value;
|
||
}
|
||
QString Address::city() const
|
||
{
|
||
return m_city;
|
||
|
||
QString Address::getCity() const {
|
||
return city;
|
||
}
|
||
|
||
void Address::setCity(const QString &city)
|
||
{
|
||
m_city = city;
|
||
void Address::setCity(const QString &value) {
|
||
city = value;
|
||
}
|
||
|
||
QList<QSharedPointer<Person> > Address::getPersons() const {
|
||
return persons;
|
||
}
|
||
|
||
void Address::setPersons(const QList<QSharedPointer<Person> > &value) {
|
||
persons = value;
|
||
}
|
||
|
||
const QHash<QString, CuteEntityManager::Relation> Address::getRelations()
|
||
const {
|
||
auto hash = Entity::getRelations();
|
||
hash.insert("persons", CuteEntityManager::Relation("persons",
|
||
RelationType::MANY_TO_MANY,
|
||
QString("addresses")));
|
||
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;
|
||
}
|
||
|
||
|
Auch abrufbar als: Unified diff
example update