setType($type); !is_null($pagent) && $this->setPayingAgent($pagent); !is_null($rp_operator) && $this->setReceivePaymentsOperator($rp_operator); !is_null($mt_operator) && $this->setMoneyTransferOperator($mt_operator); } /** * Возвращает установленный признак оператора * * @return string|null */ public function getType(): ?string { return $this->type; } /** * Устанавливает признак оператора * * @param string|null $type * @return AgentInfo * @throws InvalidEnumValueException */ public function setType(?string $type): self { AgentTypes::isValid($type) && $this->type = $type; return $this; } /** * Взвращает установленного платёжного агента * * @return PayingAgent|null */ public function getPayingAgent(): ?PayingAgent { return $this->paying_agent; } /** * Устанавливает платёжного агента * * @param PayingAgent|null $agent * @return AgentInfo */ public function setPayingAgent(?PayingAgent $agent): self { $this->paying_agent = $agent; return $this; } /** * Возвращает установленного оператора по приёму платежей * * @return ReceivePaymentsOperator|null */ public function getReceivePaymentsOperator(): ?ReceivePaymentsOperator { return $this->receive_payments_operator; } /** * Устанавливает оператора по приёму платежей * * @param ReceivePaymentsOperator|null $operator * @return AgentInfo */ public function setReceivePaymentsOperator(?ReceivePaymentsOperator $operator): self { $this->receive_payments_operator = $operator; return $this; } /** * Возвращает установленного оператора перевода * * @return MoneyTransferOperator|null */ public function getMoneyTransferOperator(): ?MoneyTransferOperator { return $this->money_transfer_operator; } /** * Устанавливает оператора перевода * * @param MoneyTransferOperator|null $operator * @return AgentInfo */ public function setMoneyTransferOperator(?MoneyTransferOperator $operator): self { $this->money_transfer_operator = $operator; return $this; } /** * @inheritDoc */ public function jsonSerialize(): array { $json = []; $this->getType() && $json['type'] = $this->getType(); $this->getPayingAgent()?->jsonSerialize() && $json['paying_agent'] = $this ->getPayingAgent()->jsonSerialize(); $this->getReceivePaymentsOperator()?->jsonSerialize() && $json['receive_payments_operator'] = $this ->getReceivePaymentsOperator()->jsonSerialize(); $this->getMoneyTransferOperator()?->jsonSerialize() && $json['money_transfer_operator'] = $this ->getMoneyTransferOperator()->jsonSerialize(); return $json; } }