cwmiller / broadworks-connector

Simple library for connecting to BroadWorks OCI-P API
MIT License
8 stars 5 forks source link

UserSharedCallAppearanceDeleteEndpointListRequest14 #48

Closed TwinMist closed 5 years ago

TwinMist commented 5 years ago

Hi Could you tell me what is wrong with the following request using "cwm/broadworks-connector": "dev-master",

$request = (new UserSharedCallAppearanceDeleteEndpointListRequest14()) ->setuserId($userId) ->setaccessDeviceEndpoint( (new AccessDeviceEndpointKey()) ->setLinePort($linePort) ->setAccessDevice( (new AccessDevice()) ->setDeviceLevel(AccessDeviceLevel::GROUP()) ->setDeviceName($deviceName) ));

PHP Fatal error: Uncaught TypeError: Argument 1 passed to CWM\BroadWorksConnector\Ocip\Models\UserSharedCallAppearanceDeleteEndpointListRequest14::setAccessDeviceEndpoint() must be of the type array, object given,

if i remove from UserSharedCallAppearanceDeleteEndpointListRequest14

public function setAccessDeviceEndpoint(array $accessDeviceEndpoint) { $this->accessDeviceEndpoint = $accessDeviceEndpoint; return $this; it works thanks

TwinMist commented 5 years ago

Hi, can you help me on this query? Many thanks

cwmiller commented 5 years ago

setAccessDeviceEndpoint expects an array of AccessDeviceEndpointKey. Use:

$request = (new UserSharedCallAppearanceDeleteEndpointListRequest14())
    ->setUserId($userId)
    ->setAccessDeviceEndpoint([
        (new AccessDeviceEndpointKey())
            ->setLinePort($linePort)
            ->setAccessDevice(
                (new AccessDevice())
                    ->setDeviceLevel(AccessDeviceLevel::GROUP())
                    ->setDeviceName($deviceName)
            )]);
TwinMist commented 4 years ago

Hi Can you test the above for me as still getting the unexpected 'array' (T_ARRAY), expecting '(' error cheers