Herunterladen als
root/samples/example/models/group.cpp @ 886bdb22
b7446f4c | Christian Ehringfeld | #include "group.h"
|
|
af84b9c4 | Christian Ehringfeld | #include "pupil.h"
|
|
b7446f4c | Christian Ehringfeld | #include <QDebug>
|
|
Group::Group() : Entity() {
|
|||
}
|
|||
const QHash<QString, CuteEntityManager::Relation> Group::getRelations() const {
|
|||
auto hash = QHash<QString, CuteEntityManager::Relation>();
|
|||
af84b9c4 | Christian Ehringfeld | hash.insert("persons", CuteEntityManager::Relation("persons",
|
|
RelationType::MANY_TO_MANY));
|
|||
d518fe54 | Christian Ehringfeld | hash.insert("pupils", CuteEntityManager::Relation("pupils",
|
|
RelationType::MANY_TO_MANY, QString("groups")));
|
|||
b7446f4c | Christian Ehringfeld | hash.insert("mainTeacher", CuteEntityManager::Relation("mainTeacher",
|
|
da565582 | Christian Ehringfeld | RelationType::MANY_TO_ONE));
|
|
b7446f4c | Christian Ehringfeld | return hash;
|
|
}
|
|||
QString Group::getName() const {
|
|||
return name;
|
|||
}
|
|||
void Group::setName(const QString &value) {
|
|||
name = value;
|
|||
}
|
|||
QList<QSharedPointer<Pupil> > Group::getPupils() const {
|
|||
return pupils;
|
|||
}
|
|||
void Group::setPupils(const QList<QSharedPointer<Pupil> > &value) {
|
|||
pupils = value;
|
|||
}
|
|||
void Group::addPupil(Pupil *pupil) {
|
|||
this->pupils.append(QSharedPointer<Pupil>(pupil));
|
|||
}
|
|||
QSharedPointer<Pupil> Group::pupilAt(int i) {
|
|||
return this->pupils.at(i);
|
|||
}
|
|||
QSharedPointer<Person> Group::getMainTeacher() const {
|
|||
return mainTeacher;
|
|||
}
|
|||
void Group::setMainTeacher(const QSharedPointer<Person> &value) {
|
|||
mainTeacher = value;
|
|||
}
|
|||
abb9e8c5 | Christian Ehringfeld | QList<QSharedPointer<Person> > Group::getPersons() const {
|
|
return persons;
|
|||
}
|
|||
void Group::addPerson(Person *person) {
|
|||
this->persons.append(QSharedPointer<Person>(person));
|
|||
}
|
|||
void Group::setPersons(const QList<QSharedPointer<Person> > &value) {
|
|||
persons = value;
|
|||
}
|
|||
b7446f4c | Christian Ehringfeld | ||