10b3fd2d3SAndreas Gohr<?php 2*dad993c5SAndreas Gohr 30b3fd2d3SAndreas Gohr/** 40b3fd2d3SAndreas Gohr * This file is part of the FreeDSx LDAP package. 50b3fd2d3SAndreas Gohr * 60b3fd2d3SAndreas Gohr * (c) Chad Sikorra <Chad.Sikorra@gmail.com> 70b3fd2d3SAndreas Gohr * 80b3fd2d3SAndreas Gohr * For the full copyright and license information, please view the LICENSE 90b3fd2d3SAndreas Gohr * file that was distributed with this source code. 100b3fd2d3SAndreas Gohr */ 110b3fd2d3SAndreas Gohr 120b3fd2d3SAndreas Gohrnamespace FreeDSx\Ldap\Protocol; 130b3fd2d3SAndreas Gohr 140b3fd2d3SAndreas Gohruse FreeDSx\Asn1\Type\AbstractType; 150b3fd2d3SAndreas Gohruse FreeDSx\Ldap\Control\Control; 160b3fd2d3SAndreas Gohruse FreeDSx\Ldap\Operation\Request\RequestInterface; 170b3fd2d3SAndreas Gohr 180b3fd2d3SAndreas Gohr/** 190b3fd2d3SAndreas Gohr * The LDAP Message envelope PDU. This represents a message as a request to LDAP. 200b3fd2d3SAndreas Gohr * 210b3fd2d3SAndreas Gohr * @see LdapMessage 220b3fd2d3SAndreas Gohr * @author Chad Sikorra <Chad.Sikorra@gmail.com> 230b3fd2d3SAndreas Gohr */ 240b3fd2d3SAndreas Gohrclass LdapMessageRequest extends LdapMessage 250b3fd2d3SAndreas Gohr{ 260b3fd2d3SAndreas Gohr /** 270b3fd2d3SAndreas Gohr * @var RequestInterface 280b3fd2d3SAndreas Gohr */ 290b3fd2d3SAndreas Gohr protected $request; 300b3fd2d3SAndreas Gohr 310b3fd2d3SAndreas Gohr /** 320b3fd2d3SAndreas Gohr * @param int $messageId 330b3fd2d3SAndreas Gohr * @param RequestInterface $request 340b3fd2d3SAndreas Gohr * @param Control ...$controls 350b3fd2d3SAndreas Gohr */ 360b3fd2d3SAndreas Gohr public function __construct(int $messageId, RequestInterface $request, Control ...$controls) 370b3fd2d3SAndreas Gohr { 380b3fd2d3SAndreas Gohr $this->request = $request; 390b3fd2d3SAndreas Gohr parent::__construct($messageId, ...$controls); 400b3fd2d3SAndreas Gohr } 410b3fd2d3SAndreas Gohr 420b3fd2d3SAndreas Gohr /** 430b3fd2d3SAndreas Gohr * @return RequestInterface 440b3fd2d3SAndreas Gohr */ 450b3fd2d3SAndreas Gohr public function getRequest(): RequestInterface 460b3fd2d3SAndreas Gohr { 470b3fd2d3SAndreas Gohr return $this->request; 480b3fd2d3SAndreas Gohr } 490b3fd2d3SAndreas Gohr 500b3fd2d3SAndreas Gohr /** 510b3fd2d3SAndreas Gohr * @return AbstractType 520b3fd2d3SAndreas Gohr */ 530b3fd2d3SAndreas Gohr protected function getOperationAsn1(): AbstractType 540b3fd2d3SAndreas Gohr { 550b3fd2d3SAndreas Gohr return $this->request->toAsn1(); 560b3fd2d3SAndreas Gohr } 570b3fd2d3SAndreas Gohr} 58