-
Notifications
You must be signed in to change notification settings - Fork 35
/
Copy pathObjectLists.php
63 lines (54 loc) · 2 KB
/
ObjectLists.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
<?php
namespace ToolkitApi;
/**
* Class ObjectLists
*
* @package ToolkitApi
*/
class ObjectLists
{
private $OBJLLISTREC_SIZE = 30;
private $ToolkitSrvObj;
private $TmpUserSpace ;
private $ErrMessage;
/**
* @param ToolkitInterface $ToolkitSrvObj
*/
public function __construct(?ToolkitInterface $ToolkitSrvObj = null)
{
if ($ToolkitSrvObj instanceof Toolkit) {
$this->ToolkitSrvObj = $ToolkitSrvObj;
return $this;
} else {
return false;
}
}
/**
* @param string $object = *ALL, *name, *generic name
* @param string $library = *ALL, *name, *generic name
* @param string $objecttype = *ALL, *type
* @return array|bool
* @throws \Exception
*/
public function getObjectList($object = '*ALL', $library = '*LIBL', $objecttype = '*ALL')
{
$ObjName = $object;
$ObjLib = $library;
$ObjType = $objecttype;
$this->TmpUserSpace = new TmpUserSpace($this->ToolkitSrvObj);
$UsFullName = $this->TmpUserSpace->getUSFullName();
$params[] = $this->ToolkitSrvObj->AddParameterChar('in', 20, "User Space Name", 'userspacename', $UsFullName);
$params[] = $this->ToolkitSrvObj->AddParameterChar('in', 10, "Object name", 'objectname', $ObjName);
$params[] = $this->ToolkitSrvObj->AddParameterChar('in', 10, "Object library", 'objectlib', $ObjLib);
$params[] = $this->ToolkitSrvObj->AddParameterChar('in', 10, "Object Type", 'objecttype', $ObjType);
$this->ToolkitSrvObj->PgmCall(ZSTOOLKITPGM, $this->ToolkitSrvObj->getOption('HelperLib'), $params, NULL, array('func' => 'OBJLST'));
$ObjList = $this->TmpUserSpace->ReadUserSpace(1, $this->TmpUserSpace->RetrieveUserSpaceSize());
$this->TmpUserSpace->DeleteUserSpace();
unset($this->TmpUserSpace);
if (trim($ObjList)!='') {
return (str_split($ObjList, $this->OBJLLISTREC_SIZE));
} else {
return false;
}
}
}