Revision abb9e8c5
Von Christian Ehringfeld vor mehr als 10 Jahren hinzugefügt
| samples/example/models/group.cpp | ||
|---|---|---|
|
|
||
|
const QHash<QString, CuteEntityManager::Relation> Group::getRelations() const {
|
||
|
auto hash = QHash<QString, CuteEntityManager::Relation>();
|
||
|
hash.insert("pupils", CuteEntityManager::Relation("pupils", MANY_TO_MANY));
|
||
|
//hash.insert("pupils", CuteEntityManager::Relation("pupils", MANY_TO_MANY));
|
||
|
hash.insert("persons", CuteEntityManager::Relation("persons", MANY_TO_MANY));
|
||
|
hash.insert("mainTeacher", CuteEntityManager::Relation("mainTeacher",
|
||
|
MANY_TO_ONE));
|
||
|
return hash;
|
||
| ... | ... | |
|
void Group::setMainTeacher(const QSharedPointer<Person> &value) {
|
||
|
mainTeacher = value;
|
||
|
}
|
||
|
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;
|
||
|
}
|
||
|
|
||
|
|
||
|
|
||
|
|
||
Auch abrufbar als: Unified diff
example not working - wip, maybe tomorrow