Closed TwinMist closed 5 years ago
This really isn't doable in PHP. Namespace importing isn't like file import via require
or include
. To use a namespaced class in a PHP file, it has to explicitly include the use
statement for that class in the PHP file that references it.
Hi, Could the system automatically include the require dependent file that are needed by the modify or add request. ie to edit the lineport of a user you need to include.
use CWM\BroadWorksConnector\Ocip\Models\UserModifyRequest17sp4; use CWM\BroadWorksConnector\Ocip\Models\AccessDevice; use CWM\BroadWorksConnector\Ocip\Models\AccessDeviceLevel; use CWM\BroadWorksConnector\Ocip\Models\AccessDeviceMultipleContactEndpointModify; use CWM\BroadWorksConnector\Ocip\Models\UserModifyRequest17sp4Endpoint;
$request = (new UserModifyRequest17sp4()) ->setUserId($userId) ->setEndpoint( (new UserModifyRequest17sp4Endpoint()) ->setAccessDeviceEndpoint( (new AccessDeviceMultipleContactEndpointModify()) ->setLinePort($lineport) ->setAccessDevice( (new AccessDevice()) ->setDeviceLevel(AccessDeviceLevel::GROUP()) ->setDeviceName($devicename) ) ) );
could the files be included within use CWM\BroadWorksConnector\Ocip\Models\UserModifyRequest17sp4;
Many thanks.