Set invoice relations

@param array|Bag $value Parameter value
@return AbstractDocument provides a fluent interface.
3971
public function setRelations($value)
    {
        if (is_array($value)) {
            $bag = new Bag();
            foreach ($value as $itemParameters) {
                $bag->add(new Relation($itemParameters));
            }
            $value = $bag;
        }
        return $this->setParameter('relations', $value);
    }
905253
public function setTags($value)
    {
        if (!is_array($value)) {
            $value = [$value];
        }

        $this->values['tags'] = implode(',', $value);

        return $this;
    }
1113694
public function setDocumentType($value)
    {
        $allowedTypes = self::allowedTypes();

        if (!in_array($value, $allowedTypes, true)) {
            throw new DomainException(self::MSG_BAD_DOCUMENT_TYPE);
        }

        return $this->setAttribute('documentType', $value);
    }
955746
public function setOrderStatus($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['OrderStatus']['FieldValue'] = $value;
        return $this;
    }
1075785
public function setCoreCacheLangJs($value)
    {
        $this->setFieldName('cache_lang_js');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
965332
public function setMessages($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['Messages']['FieldValue'] = $value;
        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);
        }
    }
198594
public function setCoreCacheNoncoreLexiconTopics($value)
    {
        $this->setFieldName('cache_noncore_lexicon_topics');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
321499
public function setCoreEmailsubject($value)
    {
        $this->setFieldName('emailsubject');
        $this->loadObject(true);
        $this->setFieldValue($value);

        return $this;
    }
1129994
public function setItems(array $value) {
    if (isset($value[0]) &&
        is_object($value[0]) &&
        !$value[0] instanceof GalleryItem
    ) {
      $this->triggerError('Object not of type GalleryItem');
    }
    else {
      $this->items = $value;
    }
    return $this;
  }
996705
public function setPayer(\AgentSIB\Diadoc\Api\Proto\Invoicing\OrganizationInfo $value = null)
    {
        $this->Payer = $value;
    }
159066
public function setInvoice(\AgentSIB\Diadoc\Api\Proto\Recognition\RecognizedInvoice $value = null)
    {
        $this->Invoice = $value;
    }
756685
public function setPaymentExecutionDetail($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['PaymentExecutionDetail']['FieldValue'] = $value;
        return $this;
    }
455399
public function fillKeys($value)
    {
        try {
            $arr = array_fill_keys($this->val(), $value);
        } catch (\ErrorException $e) {
            throw new ArrayObjectException($e->getMessage());
        }


        $this->val($arr);

        return $this;
    }
1268749
public function setRootText( $value )
    {
        $content = $this->getDependentContent();

        if ( $content )
        {
            $content->leadText = $value;
        }

        return $this;
    }
1200501
public function addEncryptedInvoices(\AgentSIB\Diadoc\Api\Proto\Events\EncryptedInvoiceAttachment $value)
    {
        if ($this->EncryptedInvoices === null) {
            $this->EncryptedInvoices = new \Protobuf\MessageCollection();
        }

        $this->EncryptedInvoices->add($value);
    }
1255901
public function setFulfillmentChannel($value)
    {
        if (!$this->_isNumericArray($value)) {
            $value = array ($value);
        }
        $this->_fields['FulfillmentChannel']['FieldValue'] = $value;
        return $this;
    }