Skip to content

Commit

Permalink
Add some clarifications to QgsRelation api
Browse files Browse the repository at this point in the history
  • Loading branch information
nyalldawson committed May 7, 2016
1 parent e9d3a3a commit d823be1
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 21 deletions.
16 changes: 8 additions & 8 deletions python/core/qgsrelation.sip
Expand Up @@ -57,32 +57,32 @@ class QgsRelation
void setRelationName( const QString& name );

/**
* Set the referencing layer id. This layer will be searched in the registry.
* Set the referencing (child) layer id. This layer will be searched in the registry.
*
* @param id
*/
void setReferencingLayer( const QString& id );

/**
* Set the referenced layer id. This layer will be searched in the registry.
* Set the referenced (parent) layer id. This layer will be searched in the registry.
*
* @param id
*/
void setReferencedLayer( const QString& id );

/**
* Add a field pairs which is part of this relation
* The first element of each pair are the field names fo the foreign key.
* The first element of each pair are the field names of the foreign key.
* The second element of each pair are the field names of the matching primary key.
*
* @param referencingField The field name on the referencing layer (FK)
* @param referencedField The field name on the referenced layer (PK)
* @param referencingField The field name on the referencing (child) layer (FK)
* @param referencedField The field name on the referenced (parent) layer (PK)
*/
void addFieldPair( const QString& referencingField, const QString& referencedField );

/**
* Add a field pairs which is part of this relation
* The first element of each pair are the field names fo the foreign key.
* The first element of each pair are the field names of the foreign key.
* The second element of each pair are the field names of the matching primary key.
*
* @param fieldPair A pair of two strings
Expand Down Expand Up @@ -206,15 +206,15 @@ class QgsRelation

/**
* Returns a list of attributes used to form the referenced fields
* (most likely primary key) on the referenced layer.
* (most likely primary key) on the referenced (parent) layer.
*
* @return A list of attributes
*/
QgsAttributeList referencedFields() const;

/**
* Returns a list of attributes used to form the referencing fields
* (foreign key) on the referencing layer.
* (foreign key) on the referencing (child) layer.
*
* @return A list of attributes
*/
Expand Down
26 changes: 13 additions & 13 deletions src/core/qgsrelation.h
Expand Up @@ -31,8 +31,8 @@ class CORE_EXPORT QgsRelation
/**
* Defines a relation between matching fields of the two involved tables of a relation.
* Often, a relation is only defined by just one FieldPair with the name of the foreign key
* column of the referencing table as first element and the name of the primary key column
* of the referenced table as the second element.
* column of the referencing (child) table as first element and the name of the primary key column
* of the referenced (parent) table as the second element.
* @note not available in Python bindings
*/
class FieldPair : public QPair< QString, QString >
Expand All @@ -46,9 +46,9 @@ class CORE_EXPORT QgsRelation
FieldPair( const QString& referencingField, const QString& referencedField )
: QPair< QString, QString >( referencingField, referencedField ) {}

//! Get the name of the referencing field
//! Get the name of the referencing (child) field
QString referencingField() const { return first; }
//! Get the name of the referenced field
//! Get the name of the referenced (parent) field
QString referencedField() const { return second; }
};

Expand Down Expand Up @@ -89,32 +89,32 @@ class CORE_EXPORT QgsRelation
void setRelationName( const QString& name );

/**
* Set the referencing layer id. This layer will be searched in the registry.
* Set the referencing (child) layer id. This layer will be searched in the registry.
*
* @param id
*/
void setReferencingLayer( const QString& id );

/**
* Set the referenced layer id. This layer will be searched in the registry.
* Set the referenced (parent) layer id. This layer will be searched in the registry.
*
* @param id
*/
void setReferencedLayer( const QString& id );

/**
* Add a field pairs which is part of this relation
* The first element of each pair are the field names fo the foreign key.
* The first element of each pair are the field names of the foreign key.
* The second element of each pair are the field names of the matching primary key.
*
* @param referencingField The field name on the referencing layer (FK)
* @param referencedField The field name on the referenced layer (PK)
* @param referencingField The field name on the referencing (child) layer (FK)
* @param referencedField The field name on the referenced (parent) layer (PK)
*/
void addFieldPair( const QString& referencingField, const QString& referencedField );

/**
* Add a field pairs which is part of this relation
* The first element of each pair are the field names fo the foreign key.
* The first element of each pair are the field names of the foreign key.
* The second element of each pair are the field names of the matching primary key.
*
* @param fieldPair A pair of two strings
Expand Down Expand Up @@ -221,7 +221,7 @@ class CORE_EXPORT QgsRelation

/**
* Returns the field pairs which form this relation
* The first element of each pair are the field names fo the foreign key.
* The first element of each pair are the field names of the foreign key.
* The second element of each pair are the field names of the matching primary key.
*
* @return The fields forming the relation
Expand All @@ -230,15 +230,15 @@ class CORE_EXPORT QgsRelation

/**
* Returns a list of attributes used to form the referenced fields
* (most likely primary key) on the referenced layer.
* (most likely primary key) on the referenced (parent) layer.
*
* @return A list of attributes
*/
QgsAttributeList referencedFields() const;

/**
* Returns a list of attributes used to form the referencing fields
* (foreign key) on the referencing layer.
* (foreign key) on the referencing (child) layer.
*
* @return A list of attributes
*/
Expand Down

0 comments on commit d823be1

Please sign in to comment.