Adds a forward relation to the page

@param  string $relation      relation name (e.g. alternate, glossary,
canonical, etc)
@param  mixed  $value         value to set for relation
@return Page  fluent interface, returns self
548844
public function addRel($relation, $value)
        {
            if (is_string($relation)) {
                $this->_rel[$relation] = $value;
            }

            return $this;
        }
794117
public function addRev($relation, $value)
        {
            if (is_string($relation)) {
                $this->_rev[$relation] = $value;
            }

            return $this;
        }
1084922
protected function setSingleRelation($relationName, $value)
    {
        /** @var BaseActiveRecord $owner */
        $owner = $this->owner;
        /** @var ActiveQuery $relation */
        $relation = $owner->getRelation($relationName);
        if (!($value instanceof $relation->modelClass)) {
            $value = $this->processModelAsArray($value, $relation, $relationName);
        }
        $this->_newRelationValue[$relationName] = $value;
        $owner->populateRelation($relationName, $value);
    }
896236
public function include($relations):SuccessResponseBuilder
    {
        if (is_string($relations)) {
            $relations = explode(',', $relations);
        }

        $this->relations = array_merge($this->relations, (array) $relations);

        return $this;
    }
1250293
public function loadRelationForPage(int $first, int $page, string $relationName, Closure $relationConstraints): self
    {
        // Load the count of relations of models, this will be the `total` argument of `Paginator`.
        // Be aware that this will reload all the models entirely with the count of their relations,
        // which will bring extra DB queries, always prefer querying without pagination if possible.
        $this->reloadModelsWithRelationCount();

        $relations = $this
            ->buildRelationsFromModels($relationName, $relationConstraints)
            ->map(
                function (Relation $relation) use ($first, $page) {
                    return $relation->forPage($page, $first);
                }
            );

        /** @var \Illuminate\Database\Eloquent\Collection $relationModels */
        $relationModels = $this
            ->unionAllRelationQueries($relations)
            ->get();

        $this->hydratePivotRelation($relationName, $relationModels);

        $this->loadDefaultWith($relationModels);

        $this->associateRelationModels($relationName, $relationModels);

        $this->convertRelationToPaginator($first, $page, $relationName);

        return $this;
    }
28501
public function setRelated($value)
    {
        $this->loadData(true);

        if (is_null($value)) {
            $value = [];
        }

        if (!is_array($value)) {
            throw new RelationException("HasMany relation can only be set with array of entities");
        }

        //Do not add items twice
        $matched = [];
        foreach ($value as $index => $record) {
            if (is_null($record)) {
                unset($value[$index]);
                continue;
            }

            $this->assertValid($record);
            if (!empty($instance = $this->matchOne($record))) {
                $matched[] = $instance;
                unset($value[$index]);
            }
        }

        //Unlink records
        foreach (array_diff($this->instances, $matched) as $record) {
            $this->unlink($record);
        }

        //Add new record
        foreach ($value as $record) {
            $this->link($record);
        }
    }
252213
public function setForwardedDocumentId(\AgentSIB\Diadoc\Api\Proto\Forwarding\ForwardedDocumentId $value = null)
    {
        $this->ForwardedDocumentId = $value;
    }
1273814
private function addRelationQuery($type, $value)
    {
        $this->prepareRelationFilter($type);
        $this->filters[$type][] = $value;
        return $this;
    }
811972
public function addPersonFunctionLinkVersion($value)
    {
        $currentArray = $this->getPersonFunctionLinkVersions();
        $currentArray []= $value;
        $this->setPersonFunctionLinkVersions($currentArray);

        return $this;
    }
560661
protected function addPolymorphicRelation(string $relation)
    {
        if (!in_array($relation, $this->polymorphicRelations)) {
            $this->polymorphicRelations[] = $relation;
        }
    }
1339506
public function addRelation(TableRelation $relation, string $name = null)
    {
        $name = $name ?? $relation->name;
        $relation->name = $name;
        $this->relations[$name] = $relation;
        return $this;
    }
946183
public function load($relation)
    {
        $item = current($this->items);
        $item->eagerlyResultSet($this->items, $relation);

        return $this;
    }
1257568
public function setCoreAllowForwardAcrossContexts($value)
    {
        $this->setFieldName('allow_forward_across_contexts');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
786020
protected function addProcessedRelation($key, $value, $type = RelationTypes::PRODUCT_RELATION)
    {
        $this->getSubject()->addProcessedRelation($key, $value, $type);
    }
392735
public function add($field, $relation, $value)
	{
		$this->conditions[] = array(
				self::FIELD_POS => $field,
				self::RELATION_POS => $relation,
				self::VALUE_POS => $value
		);
	}
909238
public function _setType(string $type, array $relation)
    {
        $this->type = $type;
        $this->relation = $relation;
        return $this;
    }
781303
protected function whenLoaded($relationship, $value = null, $default = null)
    {
        if (func_num_args() < 3) {
            $default = new MissingValue;
        }

        if (! $this->resource->relationLoaded($relationship)) {
            return value($default);
        }

        if (func_num_args() === 1) {
            return $this->resource->{$relationship};
        }

        if ($this->resource->{$relationship} === null) {
            return;
        }

        return value($value);
    }