PHP Trait Bolt\Storage\Entity\ContentRelationTrait

This is a breakout of the old Bolt\Content class and serves two main purposes: * Maintain backward compatibility for Bolt\Content through the remainder of the 2.x development/release life-cycle * Attempt to break up former functionality into sections of code that more resembles Single Responsibility Principles These traits should be considered transitional, the functionality in the process of refactor, and not representative of a valid approach.
Author: Gawain Lynch ([email protected])
Show file Open project: bolt/bolt

Public Methods

Method Description
clearRelation ( string | array $contenttype ) : void Clears a relation.
getRelation ( string $filterContentType = null, array $options = [] ) : Content[] Gets one or more related records.
related ( $filterContentType = null, $options = [] ) Alias for getRelation()
setRelation ( string | array $contenttype, integer $id ) : void Add a relation.

Method Details

clearRelation() public method

Clears a relation.
public clearRelation ( string | array $contenttype ) : void
$contenttype string | array
return void

getRelation() public method

Gets one or more related records.
public getRelation ( string $filterContentType = null, array $options = [] ) : Content[]
$filterContentType string ContentType to filter returned results on
$options array A set of 'WHERE' options to apply to the filter Backward compatability note: The $options parameter used to be $filterid, an integer.
return Bolt\Legacy\Content[]

setRelation() public method

Add a relation.
public setRelation ( string | array $contenttype, integer $id ) : void
$contenttype string | array
$id integer
return void