forked from jpcampbell/intacctws-php
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathapi_objDef.php
More file actions
44 lines (37 loc) · 1.11 KB
/
api_objDef.php
File metadata and controls
44 lines (37 loc) · 1.11 KB
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
<?php
include_once "api_fieldDef.php";
/**
* Created by JetBrains PhpStorm.
* User: aaron
* Date: 4/14/13
* Time: 1:16 PM
* To change this template use File | Settings | File Templates.
*/
class api_objDef {
public $Name;
public $SingularName;
public $PluralName;
public $Description;
public $Fields;
public function __construct(simpleXmlElement $simpleXml) {
//var_export($simpleXml);
$this->Name = (string)$simpleXml['Name'];
$this->SingularName = (string)$simpleXml->Attributes->SingularName;
$this->PluralName = (string)$simpleXml->Attributes->PluralName;
$this->Description = (string)$simpleXml->Attributes->Description;
$fields = $simpleXml->Fields;
$this->Fields = array();
foreach($fields->Field as $field) {
$fieldDef = new api_fieldDef($field);
$this->Fields[$fieldDef->Name] = $fieldDef;
}
}
public function get_field_array()
{
$array = array();
foreach ($this->Fields as $field) {
$array[] = (string)$field->Name;
}
return $array;
}
}