Skip to content

pbRelationship

Snippet for relationship output

Parameters

ParameterDefaultDescription
relationTypeone_to_oneType of relationship. Possible values: one_to_one, one_to_many, many_to_one, many_to_many
primaryTablepbTableValuePrimary table. Possible values: pbBlockValue,pbTableValue,pbResource,pbUser
primaryIdID of the primary record
relatedTablepbTableValueRelated table. Possible values: pbBlockValue,pbTableValue,pbResource,pbUser
relatedIdID of the related record

Examples

php
{'!pbRelationship'|snippet: [
    'relationType' => 'one_to_many',
    'primaryTable' => 'pbBlockValue',
    'primaryId' => 1,
    'relatedTable' => 'pbResource',
    'tpl' => 'product'
]}

© PageBlocks 2019-present