Herunterladen als
root/example/models/group.cpp @ b0e92bc6
9d05e414 | Christian Ehringfeld | #include "group.h"
|
|
#include "models/person.h"
|
|||
#include "models/group.h"
|
|||
bb5e9339 | SebastianDiel | #include "../src/relation.h"
|
|
9d05e414 | Christian Ehringfeld | //#include <QQmlListProperty>
|
|
#include <QDebug>
|
|||
Group::Group() : Entity() {
|
|||
}
|
|||
ba6f6521 | Christian Ehringfeld | QString Group::getName() const
|
|
{
|
|||
return name;
|
|||
9d05e414 | Christian Ehringfeld | }
|
|
ba6f6521 | Christian Ehringfeld | void Group::setName(const QString &value)
|
|
{
|
|||
name = value;
|
|||
9d05e414 | Christian Ehringfeld | }
|
|
ba6f6521 | Christian Ehringfeld | QSharedPointer<Teacher> Group::getTeacher() const
|
|
{
|
|||
return teacher;
|
|||
586bb527 | Christian Ehringfeld | }
|
|
ba6f6521 | Christian Ehringfeld | void Group::setTeacher(const QSharedPointer<Teacher> &value)
|
|
{
|
|||
teacher = value;
|
|||
586bb527 | Christian Ehringfeld | }
|
|
ba6f6521 | Christian Ehringfeld | QList<QSharedPointer<Pupil> > Group::getPupils() const
|
|
{
|
|||
return pupils;
|
|||
586bb527 | Christian Ehringfeld | }
|
|
ba6f6521 | Christian Ehringfeld | void Group::setPupils(const QList<QSharedPointer<Pupil> > &value)
|
|
{
|
|||
pupils = value;
|
|||
586bb527 | Christian Ehringfeld | }
|
|
ba6f6521 | Christian Ehringfeld | QList<QSharedPointer<Pupil> > Group::getClassPrefects() const
|
|
{
|
|||
return classPrefects;
|
|||
a47954c0 | Christian Ehringfeld | }
|
|
ba6f6521 | Christian Ehringfeld | void Group::setClassPrefects(const QList<QSharedPointer<Pupil> > &value)
|
|
{
|
|||
classPrefects = value;
|
|||
}
|
|||
QList<QSharedPointer<Person> > Group::getParentSpeakers() const
|
|||
{
|
|||
return parentSpeakers;
|
|||
a47954c0 | Christian Ehringfeld | }
|
|
ba6f6521 | Christian Ehringfeld | void Group::setParentSpeakers(const QList<QSharedPointer<Person> > &value)
|
|
{
|
|||
parentSpeakers = value;
|
|||
9d05e414 | Christian Ehringfeld | }
|
|
ba6f6521 | Christian Ehringfeld | const QHash<QString, Relation> Group::getRelations() const
|
|
{
|
|||
auto hash = Entity::getRelations();
|
|||
hash.insert("teacher",Relation("teacher",MANY_TO_ONE,false));
|
|||
hash.insert("pupils",Relation("pupils",MANY_TO_MANY));
|
|||
hash.insert("classPrefects",Relation("classPrefects",MANY_TO_MANY));
|
|||
hash.insert("parentSpeakers",Relation("parentSpeakers",MANY_TO_MANY));
|
|||
return hash;
|
|||
a47954c0 | Christian Ehringfeld | }
|
|
ba6f6521 | Christian Ehringfeld | ||
9d05e414 | Christian Ehringfeld | ||