PHP Class Locker\Repository\Statement\EloquentLinker

Inheritance: extends EloquentReader, implements Locker\Repository\Statement\LinkerInterface
Show file Open project: learninglocker/learninglocker

Public Methods

Method Description
updateReferences ( array $statements, StoreOptions $opts ) Updates statement references.

Protected Methods

Method Description
getModel ( String $statement_id, StoreOptions $opts ) : [Model] Gets the statement as an associative array from the database.
getModels ( [\stdClass] $statements, StoreOptions $opts ) : [Model] Gets the statements as an array from the database.
isReferencing ( stdClass $statement ) : boolean Determines if a statement is a referencing statement.

Private Methods

Method Description
downLink ( Model $model, array $visited, StoreOptions $opts ) : [Model] Goes down the reference chain setting references (refs).
downRef ( stdClass $statement, StoreOptions $opts ) : Model Gets the statement referred to by the given statement.
eagerLoadUpRefs ( array $statement_ids, StoreOptions $opts ) : [\stdClass] Gets the statements referencing the given statement ids.
fetchUpRefs ( stdClass $statement, StoreOptions $opts ) : [\stdClass] Gets the statements referencing the given statement from the database
setRefs ( stdClass $statement, array $refs, StoreOptions $opts ) Updates the refs for the given statement.
unQueue ( Model $model ) Unqueues the statement so that it doesn't get relinked.
upLink ( Model $model, array $visited, StoreOptions $opts, $useInitialUpRefs = false ) : [Model] Goes up the reference chain until it reaches the top then goes down setting references.
upRefs ( stdClass $statement, StoreOptions $opts, boolean $useInitialUpRefs ) : [\stdClass] Gets the statements referencing the given statement.

Method Details

getModel() protected method

Gets the statement as an associative array from the database.
protected getModel ( String $statement_id, StoreOptions $opts ) : [Model]
$statement_id String Statement's UUID.
$opts StoreOptions
return [Model]

getModels() protected method

Gets the statements as an array from the database.
protected getModels ( [\stdClass] $statements, StoreOptions $opts ) : [Model]
$statements [\stdClass]
$opts StoreOptions
return [Model]

isReferencing() protected method

Determines if a statement is a referencing statement.
protected isReferencing ( stdClass $statement ) : boolean
$statement stdClass
return boolean

updateReferences() public method

Updates statement references.
public updateReferences ( array $statements, StoreOptions $opts )
$statements array
$opts StoreOptions