Bravo3\Orm\Services\RelationshipManager::updateRefs PHP Method

updateRefs() private method

Update references to this entity (such as conditional sort indices)
private updateRefs ( string $table_name, string $local_id, Reader $reader )
$table_name string Local table name
$local_id string Local entity ID
$reader Bravo3\Orm\Services\Io\Reader Local entity reader
    private function updateRefs($table_name, $local_id, Reader $reader)
    {
        $ref_key = $this->getKeyScheme()->getEntityRefKey($table_name, $local_id);
        $refs = $this->getDriver()->getRefs($ref_key);
        foreach ($refs as $ref) {
            $relationship = $this->getMapper()->getEntityMetadata($ref->getSourceClass())->getRelationshipByName($ref->getRelationshipName());
            if ($relationship->getSortableBy()) {
                $this->updateMaintainedRelationshipSortIndices($relationship, [$ref->getEntityId()], $reader, $local_id);
            }
        }
    }