20 $docProps = $this->spreadsheet->getProperties();
21 $officeProperty = $xml->children($namespacesMeta[
'office']);
22 foreach ($officeProperty as $officePropertyData) {
24 if (isset($namespacesMeta[
'dc'])) {
25 $officePropertiesDC = $officePropertyData->children($namespacesMeta[
'dc']);
29 $officePropertyMeta = (object) [];
30 if (isset($namespacesMeta[
'dc'])) {
31 $officePropertyMeta = $officePropertyData->children($namespacesMeta[
'meta']);
33 foreach ($officePropertyMeta as $propertyName => $propertyValue) {
34 $this->
setMetaProperties($namespacesMeta, $propertyValue, $propertyName, $docProps);
41 foreach ($officePropertyDC as $propertyName => $propertyValue) {
42 $propertyValue = (string) $propertyValue;
43 switch ($propertyName) {
45 $docProps->setTitle($propertyValue);
49 $docProps->setSubject($propertyValue);
53 $docProps->setCreator($propertyValue);
54 $docProps->setLastModifiedBy($propertyValue);
58 $docProps->setModified($propertyValue);
62 $docProps->setDescription($propertyValue);
75 $propertyValueAttributes = $propertyValue->attributes($namespacesMeta[
'meta']);
76 $propertyValue = (string) $propertyValue;
77 switch ($propertyName) {
78 case 'initial-creator':
79 $docProps->setCreator($propertyValue);
83 $docProps->setKeywords($propertyValue);
87 $docProps->setCreated($propertyValue);
99 $propertyValueName =
'';
100 $propertyValueType = DocumentProperties::PROPERTY_TYPE_STRING;
101 foreach ($propertyValueAttributes as
$key => $value) {
102 if (
$key ==
'name') {
103 $propertyValueName = (string) $value;
104 } elseif (
$key ==
'value-type') {
107 $propertyValue = DocumentProperties::convertProperty($propertyValue,
'date');
108 $propertyValueType = DocumentProperties::PROPERTY_TYPE_DATE;
112 $propertyValue = DocumentProperties::convertProperty($propertyValue,
'bool');
113 $propertyValueType = DocumentProperties::PROPERTY_TYPE_BOOLEAN;
117 $propertyValue = DocumentProperties::convertProperty($propertyValue,
'r4');
118 $propertyValueType = DocumentProperties::PROPERTY_TYPE_FLOAT;
122 $propertyValueType = DocumentProperties::PROPERTY_TYPE_STRING;
127 $docProps->setCustomProperty($propertyValueName, $propertyValue, $propertyValueType);
setMetaProperties( $namespacesMeta, SimpleXMLElement $propertyValue, $propertyName, DocumentProperties $docProps)
setCoreProperties(DocumentProperties $docProps, SimpleXMLElement $officePropertyDC)
setUserDefinedProperty($propertyValueAttributes, $propertyValue, DocumentProperties $docProps)
__construct(Spreadsheet $spreadsheet)
load(SimpleXMLElement $xml, $namespacesMeta)