Skip to content

Commit

Permalink
exposed Model/Related types on Relation classes
Browse files Browse the repository at this point in the history
  • Loading branch information
silverqx committed Aug 7, 2022
1 parent 796975d commit c5871f4
Show file tree
Hide file tree
Showing 7 changed files with 25 additions and 6 deletions.
4 changes: 3 additions & 1 deletion include/orm/tiny/relations/belongsto.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ namespace Orm::Tiny::Relations
const QString &relationName);

public:
/*! Related instance type passed to the relation. */
/*! Parent Model type. */
using ModelType = Model;
/*! Related type. */
using RelatedType = Related;

/*! Virtual destructor. */
Expand Down
6 changes: 5 additions & 1 deletion include/orm/tiny/relations/belongstomany.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -45,8 +45,12 @@ namespace Orm::Tiny::Relations
inline BelongsToMany(const BelongsToMany &) = default;

public:
/*! Related instance type passed to the relation. */
/*! Parent Model type. */
using ModelType = Model;
/*! Related type. */
using RelatedType = Related;
/*! Pivot type. */
using PivotTypeType = PivotType;

/*! Virtual destructor. */
inline ~BelongsToMany() override = default;
Expand Down
4 changes: 3 additions & 1 deletion include/orm/tiny/relations/hasmany.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,9 @@ namespace Orm::Tiny::Relations
const QString &foreignKey, const QString &localKey);

public:
/*! Related instance type passed to the relation. */
/*! Parent Model type. */
using ModelType = Model;
/*! Related type. */
using RelatedType = Related;

/*! Virtual destructor. */
Expand Down
4 changes: 3 additions & 1 deletion include/orm/tiny/relations/hasone.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,9 @@ namespace Orm::Tiny::Relations
const QString &foreignKey, const QString &localKey);

public:
/*! Related instance type passed to the relation. */
/*! Parent Model type. */
using ModelType = Model;
/*! Related type. */
using RelatedType = Related;

/*! Virtual destructor. */
Expand Down
4 changes: 3 additions & 1 deletion include/orm/tiny/relations/hasoneormany.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,9 @@ namespace Orm::Tiny::Relations
const QString &foreignKey, const QString &localKey);

public:
/*! Related instance type passed to the relation. */
/*! Parent Model type. */
using ModelType = Model;
/*! Related type. */
using RelatedType = Related;

/*! Pure virtual destructor. */
Expand Down
4 changes: 3 additions & 1 deletion include/orm/tiny/relations/relation.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,9 @@ namespace Relations
inline Relation(const Relation &) = default;

public:
/*! Related instance type passed to the relation. */
/*! Parent Model type. */
using ModelType = Model;
/*! Related type. */
using RelatedType = Related;

/*! Pure virtual destructor. */
Expand Down
5 changes: 5 additions & 0 deletions include/orm/tiny/relations/relationproxies.hpp
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,11 @@ namespace Tiny::Relations
inline RelationProxies(const RelationProxies &) = default;

public:
/*! Parent Model type. */
using ModelType = Model;
/*! Related type. */
using RelatedType = Related;

/*! Default constructor. */
inline RelationProxies() = default;
/*! Pure virtual destructor. */
Expand Down

0 comments on commit c5871f4

Please sign in to comment.