Beispiel #1
0
 public function hashCode()
 {
     if (empty($this->hash)) {
         $this->hash = XMLAUtil::javaStringHashCode($this->uniqueName);
     }
     return $this->hash;
 }
 public function handle(DOMElement $row, XMLAConnectionContext $context, NamedList $list)
 {
     $hierarchyUniqueName = XMLAUtil::stringElement($row, 'HIERARCHY_UNIQUE_NAME');
     $hierarchyName = XMLAUtil::stringElement($row, 'HIERARCHY_NAME') == NULL ? str_replace(array('[', ']'), array('', ''), $hierarchyUniqueName) : XMLAUtil::stringElement($row, 'HIERARCHY_NAME');
     $hierarchyCaption = XMLAUtil::stringElement($row, 'HIERARCHY_CAPTION');
     $description = XMLAUtil::stringElement($row, 'DESCRIPTION');
     $allMember = XMLAUtil::stringElement($row, 'ALL_MEMBER');
     $defaultMemberUniqueName = XMLAUtil::stringElement($row, 'DEFAULT_MEMBER');
     $hierarchy = new XMLAHierarchy($context->getDimension($row), $hierarchyUniqueName, $hierarchyName, $hierarchyCaption, $description, $allMember != NULL, $defaultMemberUniqueName);
     $list->add($hierarchy);
     $this->cube->hierarchiesByUname[$hierarchy->getUniqueName()] = $hierarchy;
 }
 public function handle(\DOMElement $row, XMLAConnectionContext $context, NamedList $list)
 {
     $dimensionName = XMLAUtil::stringElement($row, 'DIMENSION_NAME');
     $dimensionUniqueName = XMLAUtil::stringElement($row, 'DIMENSION_UNIQUE_NAME');
     $dimensionCaption = XMLAUtil::stringElement($row, 'DIMENSION_CAPTION');
     $description = XMLAUtil::stringElement($row, 'DESCRIPTION');
     $dimensionType = XMLAUtil::integerElement($row, 'DIMENSION_TYPE');
     $type = DimensionType::getDictionary()->forOrdinal($dimensionType);
     $defaultHierarchyUniqueName = XMLAUtil::stringElement($row, 'DEFAULT_HIERARCHY');
     $dimensionOrdinal = XMLAUtil::integerElement($row, 'DIMENSION_ORDINAL');
     $dimension = new XMLADimension($this->cube, $dimensionUniqueName, $dimensionName, $dimensionCaption, $description, $type, $defaultHierarchyUniqueName, $dimensionOrdinal == NULL ? 0 : $dimensionOrdinal);
     $list->add($dimension);
     $this->cube->dimensionsByUname[$dimension->getUniqueName()] = $dimension;
 }
 public function handle(DOMElement $row, XMLAConnectionContext $context, NamedList $list)
 {
     /*
           Example:
     
      <row>
          <CATALOG_NAME>FoodMart</CATALOG_NAME>
          <DESCRIPTION>No description available</DESCRIPTION>
          <ROLES>California manager,No HR Cube</ROLES>
      </row>
     */
     $catalogName = XMLAUtil::stringElement($row, 'CATALOG_NAME');
     // Unused: DESCRIPTION, ROLES
     $list->add(new XMLACatalog($context->xmlaDatabaseMetaData, $catalogName));
 }
 public function handle(DOMElement $row, XMLAConnectionContext $context, NamedList $list)
 {
     $schemaName = XMLAUtil::stringElement($row, "SCHEMA_NAME") === NULL ? '' : XMLAUtil::stringElement($row, "SCHEMA_NAME");
     $catalogName = XMLAUtil::stringElement($row, "CATALOG_NAME");
     if (!$catalogName && XMLAUtil::stringElement($row, "CUBE_NAME")) {
         $catalogName = XMLAUtil::stringElement($row, "CUBE_NAME");
     }
     //print $catalogName . ':' . $schemaName . PHP_EOL;
     //echo 'XMLACatalogSchmeHandler: before if';
     if ($this->catalogName == $catalogName && $list->get($schemaName) === NULL) {
         //echo 'XMLACatalogSchmeHandler: inside if';
         if ($schemaName !== null) {
             $list->add(new XMLASchema($context->getCatalog($row), $schemaName));
         }
     }
 }
 public function handle(DOMElement $row, XMLAConnectionContext $context, NamedList $list)
 {
     /*
           Example:
     
           <row>
               <CATALOG_NAME>FoodMart</CATALOG_NAME>
               <SCHEMA_NAME>FoodMart</SCHEMA_NAME>
               <CUBE_NAME>Warehouse</CUBE_NAME>
               <SET_NAME>[Top Sellers]</SET_NAME>
               <SCOPE>1</SCOPE>
           </row>
     */
     $setName = XMLAUtil::stringElement($row, 'SET_NAME');
     $list->add(new XMLANamedSet($context->getCube($row), $setName));
 }
 public function handle(DOMElement $row, XMLAConnectionContext $context, NamedList $list)
 {
     /*
           Example:
     
           <row>
               <CATALOG_NAME>FoodMart</CATALOG_NAME>
               <SCHEMA_NAME>FoodMart</SCHEMA_NAME>
               <CUBE_NAME>Sales</CUBE_NAME>
               <MEASURE_NAME>Profit</MEASURE_NAME>
               <MEASURE_UNIQUE_NAME>[Measures].[Profit]</MEASURE_UNIQUE_NAME>
               <MEASURE_CAPTION>Profit</MEASURE_CAPTION>
               <MEASURE_AGGREGATOR>127</MEASURE_AGGREGATOR>
               <DATA_TYPE>130</DATA_TYPE>
               <MEASURE_IS_VISIBLE>true</MEASURE_IS_VISIBLE>
               <DESCRIPTION>Sales Cube - Profit Member</DESCRIPTION>
           </row>
     */
     $measureName = XMLAUtil::stringElement($row, 'MEASURE_NAME');
     $measureUniqueName = XMLAUtil::stringElement($row, 'MEASURE_UNIQUE_NAME');
     $measureCaption = XMLAUtil::stringElement($row, 'MEASURE_CAPTION');
     $description = XMLAUtil::stringElement($row, 'DESCRIPTION');
     $measureAggregator = NULL;
     /*$measureAggregator =
       MeasureAggregator::getDictionary ( )::forOrdinal (
          XMLAUtil::integerElement (
             $row, 'MEASURE_AGGREGATOR' ) );*/
     // Figure out datatype
     $datatype = NULL;
     $ordinalDatatype = DataType::getDictionary()->forName(XMLAUtil::stringElement($row, 'DATA_TYPE'));
     if ($ordinalDatatype == null) {
         $datatype = Datatype::getDictionary()->forOrdinal(XMLAUtil::integerElement($row, 'DATA_TYPE'));
     } else {
         $datatype = $ordinalDatatype;
     }
     $measureIsVisible = XMLAUtil::booleanElement($row, 'MEASURE_IS_VISIBLE');
     $member = $context->getCube($row)->getMetadataReader()->lookupMemberByUniqueName($measureUniqueName);
     if ($member == null) {
         throw new OLAPException('The server failed to resolve a member with the same unique name as a measure named ' . $measureUniqueName);
     }
     $list->add(new XMLAMeasure($member->getLevel(), $measureUniqueName, $measureName, $measureCaption, $description, null, $measureAggregator, $datatype, $measureIsVisible, $member->getOrdinal()));
 }
 public function handle(DOMElement $row, XMLAConnectionContext $context, NamedList $list)
 {
     $memberOrdinal = XMLAUtil::integerElement($row, 'LEVEL_NUMBER');
     $memberUniqueName = XMLAUtil::stringElement($row, 'MEMBER_UNIQUE_NAME');
     $memberName = XMLAUtil::stringElement($row, 'MEMBER_NAME');
     $parentUniqueName = XMLAUtil::stringElement($row, 'PARENT_UNIQUE_NAME');
     $memberTypeValues = MemberType::values();
     $memberType = $memberTypeValues[XMLAUtil::integerElement($row, 'MEMBER_TYPE')];
     $memberCaption = XMLAUtil::stringElement($row, 'MEMBER_CAPTION');
     $childrenCardinality = XMLAUtil::integerElement($row, 'CHILDREN_CARDINALITY');
     $level = $context->getLevel($row);
     $map = array();
     $this->addUserDefinedDimensionProperties($row, $level, $map);
     $depth = XMLAUtil::integerElement($row, 'DEPTH');
     if ($depth && $depth != $level->getDepth()) {
         $map['DEPTH'] = $depth;
     }
     $member = new XMLAMember($level, $memberUniqueName, $memberName, $memberCaption, "", $parentUniqueName, $memberType, $childrenCardinality, $memberOrdinal, $map);
     $list->add($member);
 }
 public function handle(DOMElement $row, XMLAConnectionContext $context, NamedList $list)
 {
     /*
           Example:
     
           <row>
               <CATALOG_NAME>FoodMart</CATALOG_NAME>
               <SCHEMA_NAME>FoodMart</SCHEMA_NAME>
               <CUBE_NAME>Sales</CUBE_NAME>
               <DIMENSION_UNIQUE_NAME>[Customers]</DIMENSION_UNIQUE_NAME>
               <HIERARCHY_UNIQUE_NAME>[Customers]</HIERARCHY_UNIQUE_NAME>
               <LEVEL_NAME>(All)</LEVEL_NAME>
               <LEVEL_UNIQUE_NAME>[Customers].[(All)]</LEVEL_UNIQUE_NAME>
               <LEVEL_CAPTION>(All)</LEVEL_CAPTION>
               <LEVEL_NUMBER>0</LEVEL_NUMBER>
               <LEVEL_CARDINALITY>1</LEVEL_CARDINALITY>
               <LEVEL_TYPE>1</LEVEL_TYPE>
               <CUSTOM_ROLLUP_SETTINGS>0</CUSTOM_ROLLUP_SETTINGS>
               <LEVEL_UNIQUE_SETTINGS>3</LEVEL_UNIQUE_SETTINGS>
               <LEVEL_IS_VISIBLE>true</LEVEL_IS_VISIBLE>
               <DESCRIPTION>Sales Cube - Customers Hierarchy - (All)
               Level</DESCRIPTION>
           </row>
     */
     $levelUniqueName = XMLAUtil::stringElement($row, 'LEVEL_UNIQUE_NAME');
     // SAP BW doesn't return a HIERARCHY_NAME attribute,
     // so try to use the unique name instead
     $levelName = XMLAUtil::stringElement($row, 'LEVEL_NAME') == null ? $levelUniqueName != null ? ereg_replace("\\]\$", "", ereg_replace("^\\[", "", $levelUniqueName)) : null : XMLAUtil::stringElement($row, 'LEVEL_NAME');
     $levelCaption = XMLAUtil::stringElement($row, 'LEVEL_CAPTION');
     $description = XMLAUtil::stringElement($row, 'DESCRIPTION');
     $levelNumber = XMLAUtil::integerElement($row, 'LEVEL_NUMBER');
     $levelTypeCode = XMLAUtil::integerElement($row, 'LEVEL_TYPE');
     $levelType = LevelType::getDictionary()->forOrdinal($levelTypeCode);
     $calculated = ($levelTypeCode & self::MDLEVEL_TYPE_CALCULATED) != 0;
     $levelCardinality = XMLAUtil::integerElement($row, 'LEVEL_CARDINALITY');
     $level = new XMLALevel($context->getHierarchy($row), $levelUniqueName, $levelName, $levelCaption, $description, $levelNumber, $levelType, $calculated, $levelCardinality);
     $list->add($level);
     $this->cubeForCallback->levelsByUname[$level->getUniqueName()] = $level;
 }
 public function handle(DOMElement $row, XMLAConnectionContext $context, NamedList $list)
 {
     /*
           Example:
     
           <row>
        <CATALOG_NAME>FoodMart</CATALOG_NAME>
        <SCHEMA_NAME>FoodMart</SCHEMA_NAME>
        <CUBE_NAME>HR</CUBE_NAME>
        <DIMENSION_UNIQUE_NAME>[Store]</DIMENSION_UNIQUE_NAME>
        <HIERARCHY_UNIQUE_NAME>[Store]</HIERARCHY_UNIQUE_NAME>
        <LEVEL_UNIQUE_NAME>[Store].[Store Name]</LEVEL_UNIQUE_NAME>
        <PROPERTY_NAME>Store Manager</PROPERTY_NAME>
        <PROPERTY_CAPTION>Store Manager</PROPERTY_CAPTION>
        <PROPERTY_TYPE>1</PROPERTY_TYPE>
        <DATA_TYPE>130</DATA_TYPE>
        <PROPERTY_CONTENT_TYPE>0</PROPERTY_CONTENT_TYPE>
        <DESCRIPTION>HR Cube - Store Hierarchy - Store
            Name Level - Store Manager Property</DESCRIPTION>
           </row>
     */
     $description = XMLAUtil::stringElement($row, 'DESCRIPTION');
     $uniqueName = XMLAUtil::stringElement($row, 'DESCRIPTION');
     $caption = XMLAUtil::stringElement($row, 'PROPERTY_CAPTION');
     $name = XMLAUtil::stringElement($row, 'PROPERTY_NAME');
     $datatype = null;
     $ordinalDatatype = DataType::getDictionary()->forName(XMLAUtil::stringElement($row, 'DATA_TYPE'));
     if ($ordinalDatatype == null) {
         $datatype = DataType::getDictionary()->forOrdinal(XMLAUtil::integerElement($row, 'DATA_TYPE'));
     } else {
         $datatype = $ordinalDatatype;
     }
     $contentTypeOrdinal = XMLAUtil::integerElement($row, 'PROPERTY_CONTENT_TYPE');
     $contentType = $contentTypeOrdinal == null ? null : PropertyContentType::getDictionary()->forOrdinal($contentTypeOrdinal);
     $propertyType = XMLAUtil::integerElement($row, 'PROPERTY_TYPE');
     $type = PropertyType::getDictionary()->forMask($propertyType);
     $list->add(new XMLAProperty($uniqueName, $name, $caption, $description, $datatype, $type, $contentType));
 }
Beispiel #11
0
 /**
  * @param $root Response root element.
  *
  * @throws OLAPException
  */
 private function createMetaData(DOMElement $root)
 {
     $olapInfo = XMLAUtil::findChild($root, XMLAUtil::MDDATASET_NS, "OlapInfo");
     $cubeInfo = XMLAUtil::findChild($olapInfo, XMLAUtil::MDDATASET_NS, "CubeInfo");
     $cubeNode = XMLAUtil::findChild($cubeInfo, XMLAUtil::MDDATASET_NS, "Cube");
     $cubeNameNode = XMLAUtil::findChild($cubeNode, XMLAUtil::MDDATASET_NS, "CubeName");
     $cubeName = XMLAUtil::gatherText($cubeNameNode);
     // REVIEW: If there are multiple cubes with the same name, we should
     // qualify by catalog and schema. Currently we just take the first.
     $cube = $this->lookupCube($this->statement->getConnection()->getMetadata(), $cubeName);
     if ($cube == null) {
         throw new OLAPException("Internal error: cube '{$cubeName}' not found.");
     }
     // REVIEW: We should not modify the connection. It is not safe, because
     // connection might be shared between multiple statements with different
     // cubes. Caller should call
     //
     // connection.setCatalog(
     //   cellSet.getMetaData().getCube().getSchema().getCatalog().getName())
     //
     // before doing metadata queries.
     $this->statement->getConnection()->setCatalog($cube->getSchema()->getCatalog()->getName());
     $axesInfo = XMLAUtil::findChild($olapInfo, XMLAUtil::MDDATASET_NS, "AxesInfo");
     $axisInfos = XMLAUtil::findChildren($axesInfo, XMLAUtil::MDDATASET_NS, "AxisInfo");
     $axisMetaDataList = array();
     $filterAxisMetaData = null;
     foreach ($axisInfos as $axisInfo) {
         $axisName = $axisInfo->getAttribute('name');
         $axis = $this->lookupAxis($axisName);
         $hierarchyInfos = XMLAUtil::findChildren($axisInfo, XMLAUtil::MDDATASET_NS, 'HierarchyInfo');
         $hierarchyList = array();
         /*
                 <OlapInfo>
            <AxesInfo>
                <AxisInfo name="Axis0">
                    <HierarchyInfo name="Customers">
                        <UName name="[Customers].[MEMBER_UNIQUE_NAME]"/>
                        <Caption name="[Customers].[MEMBER_CAPTION]"/>
                        <LName name="[Customers].[LEVEL_UNIQUE_NAME]"/>
                        <LNum name="[Customers].[LEVEL_NUMBER]"/>
                        <DisplayInfo name="[Customers].[DISPLAY_INFO]"/>
                    </HierarchyInfo>
                </AxisInfo>
                ...
            </AxesInfo>
            <CellInfo>
                <Value name="VALUE"/>
                <FmtValue name="FORMATTED_VALUE"/>
                <FormatString name="FORMAT_STRING"/>
            </CellInfo>
                 </OlapInfo>
         */
         $propertyList = array();
         foreach ($hierarchyInfos as $hierarchyInfo) {
             $hierarchyName = $hierarchyInfo->getAttribute('name');
             $hierarchy = $this->lookupHierarchy($cube, $hierarchyName);
             $hierarchyList[] = $hierarchy;
             foreach (XMLAUtil::childElements($hierarchyInfo) as $childNode) {
                 $tag = $childNode->localName;
                 if (in_array($tag, self::$standardProperties)) {
                     continue;
                 }
                 $propertyUniqueName = $childNode->getAttribute('name');
                 $property = new XMLACellSetMemberProperty($propertyUniqueName, $hierarchy, $tag);
                 $propertyList[] = $property;
             }
         }
         $axisMetaData = new XMLACellSetAxisMetaData($this->statement->getConnection(), $axis, $hierarchyList, $propertyList);
         if ($axis->isFilter()) {
             $filterAxisMetaData = $axisMetaData;
         } else {
             $axisMetaDataList[] = $axisMetaData;
         }
     }
     if ($filterAxisMetaData == null) {
         $filterAxisMetaData = new XMLACellSetAxisMetaData($this->statement->getConnection(), Axis::getEnum(Axis::FILTER), array(), array());
     }
     $cellInfo = XMLAUtil::findChild($olapInfo, XMLAUtil::MDDATASET_NS, 'CellInfo');
     $cellProperties = array();
     foreach (XMLAUtil::childElements($cellInfo) as $element) {
         $cellProperties[] = new XMLACellProperty($element->localName, $element->getAttribute('name'));
     }
     return new XMLACellSetMetaData($this->statement, $cube, $filterAxisMetaData, $axisMetaDataList, $cellProperties);
 }
 /**
  * @return XMLACatalog
  */
 public function getCatalog(DOMElement $row)
 {
     if ($this->xmlaCatalog != null) {
         return $this->xmlaCatalog;
     }
     $catalogName = XMLAUtil::stringElement($row, 'CATALOG_NAME');
     return $this->xmlaConnection->getCatalogs()->get($catalogName);
 }
 /**
  * Executes an XMLA metadata request and returns the root element of the
  * response.
  *
  * @param $request XMLA request string
  *
  * @return DOMElement Root element of the response
  * @throws OLAPException on error
  */
 public function executeMetadataRequest($request, $cachable = true)
 {
     // check the cache for data before executing the meta data request
     $requestHash = crc32($request);
     if (array_key_exists($requestHash, $this->localCache)) {
         return $this->localCache[$requestHash];
     } else {
         if ($cachable && $this->cache != null && ($cachedResponseXML = $this->cache->get($requestHash)) != false) {
             if ($this->logger && $this->debug) {
                 $this->logger->debug(__CLASS__, '********************** Cache hit **********************');
             }
             $doc = new \DOMDocument();
             $doc->loadXML($cachedResponseXML);
         } else {
             if ($this->logger && $this->debug) {
                 $this->logger->debug(__CLASS__, '********************** SENDING REQUEST **********************');
                 $this->logger->debug(__CLASS__, $request);
             }
             $doc = $this->sendXMLA($request);
             if ($this->logger && $this->debug) {
                 $this->logger->debug(__CLASS__, '******* RECEIVED RESPONSE *******');
                 $this->logger->debug(__CLASS__, $doc->saveXML());
             }
             $cachableXML = $doc->saveXML();
             if ($cachable && $this->cache != null) {
                 $this->cache->set($requestHash, $cachableXML);
             }
         }
     }
     // <SOAP-ENV:Envelope>
     //   <SOAP-ENV:Header/>
     //   <SOAP-ENV:Body>
     //     <xmla:DiscoverResponse>
     //       <xmla:return>
     //         <root>
     //           (see below)
     //         </root>
     //       <xmla:return>
     //     </xmla:DiscoverResponse>
     //   </SOAP-ENV:Body>
     // </SOAP-ENV:Envelope>
     $envelope = $doc->documentElement;
     //if (DEBUG) {
     //   System.out.println("** SERVER RESPONSE :");
     //   System.out.println(XmlaOlap4jUtil.toString(doc, true));
     //}
     assert($envelope->localName == 'Envelope');
     assert($envelope->namespaceURI == XMLAUtil::SOAP_NS);
     $body = XMLAUtil::findChild($envelope, XMLAUtil::SOAP_NS, 'Body');
     $fault = XMLAUtil::findChild($body, XMLAUtil::SOAP_NS, 'Fault');
     if ($fault != null) {
         // had an error, need to invalidate the cached item so we don't end up
         // caching invalid data
         if ($cachable && $this->cache != null) {
             $this->cache->delete($requestHash);
         }
         /*
                 <SOAP-ENV:Fault>
           <faultcode>SOAP-ENV:Client.00HSBC01</faultcode>
           <faultstring>XMLA connection datasource not found</faultstring>
           <faultactor>Mondrian</faultactor>
           <detail>
               <XA:error xmlns:XA="http://mondrian.sourceforge.net">
                   <code>00HSBC01</code>
                   <desc>The Mondrian XML: Mondrian Error:Internal
                       error: no catalog named 'LOCALDB'</desc>
               </XA:error>
           </detail>
                 </SOAP-ENV:Fault>
         */
         // TODO: log doc to logfile
         $fault = $fault->ownerDocument->saveXML($fault);
         //$request = $request->ownerDocument->saveXML ( $request );
         throw new OLAPException('XMLA provider gave exception: ' . $fault . ' Request [' . $request . ']');
         //throw getHelper().createException(
         //    "XMLA provider gave exception: "
         //    + XmlaOlap4jUtil.prettyPrint(fault)
         //    + "\n"
         //    + "Request was:\n"
         //    + request);
     }
     $discoverResponse = XMLAUtil::findChild($body, XMLAUtil::XMLA_NS, 'DiscoverResponse');
     $returnElement = XMLAUtil::findChild($discoverResponse, XMLAUtil::XMLA_NS, 'return');
     $rootElement = XMLAUtil::findChild($returnElement, XMLAUtil::ROWSET_NS, 'root');
     // cache this element locally for future retrieval
     $this->localCache[$requestHash] = $rootElement;
     return $rootElement;
 }
 /**
  * @brief Executes an MDX Query via SOAP XMLA
  *
  * @param string $mdx - The MDX Query String to execute
  *
  * @return XMLACellSet An XMLA Cell Set, which implements ICellSet
  */
 public function executeOlapQuery($mdx)
 {
     $logPerformance = $this->logPerformance;
     if ($this->logger) {
         if ($logPerformance) {
             $startTime = XMLAUtil::microtimeFloat();
         }
         $this->logger->debug(__CLASS__, '[MDX QUERY]' . PHP_EOL . $mdx);
     }
     $this->statement = $mdx;
     $catalog = $this->con->getCatalog();
     $dataSourceInfo = $this->con->getDataSourceInfo();
     $queryXML = "\n         <Execute xmlns=\"urn:schemas-microsoft-com:xml-analysis\">\n            <Command>\n               <Statement>\n                  <![CDATA[\n                     {$mdx}\n                  ]]>\n               </Statement>\n            </Command>\n            <Properties>\n               <PropertyList>\n                  <Catalog>{$catalog}</Catalog>\n                  <DataSourceInfo>{$dataSourceInfo}</DataSourceInfo>\n                  <Format>Multidimensional</Format>\n                  <AxisFormat>TupleFormat</AxisFormat>\n               </PropertyList>\n            </Properties>\n         </Execute>\n      ";
     // submit the MDX query
     if ($logPerformance) {
         $submitStartTime = XMLAUtil::microtimeFloat();
     }
     $dom = $this->con->submit($queryXML);
     if ($logPerformance) {
         $submitEndTime = XMLAUtil::microtimeFloat() - $submitStartTime;
     }
     // populate the MDX query results into a cellset
     if ($logPerformance) {
         $populateStartTime = XMLAUtil::microtimeFloat();
     }
     if (empty($this->cellSet)) {
         $this->cellSet = new XMLACellSet($this);
     }
     $this->cellSet->populate($dom);
     if ($logPerformance) {
         $populateEndTime = XMLAUtil::microtimeFloat() - $populateStartTime;
     }
     // log timing of method calls for performance tuning
     if ($logPerformance && $this->logger) {
         $this->logger->debug(__CLASS__, "[MDX SUBMIT TIME] " . $submitEndTime);
         $this->logger->debug(__CLASS__, "[MDX POPULATE TIME] " . $populateEndTime);
         $this->logger->debug(__CLASS__, "[MDX TOTAL TIME] " . (DateTime::microtimeFloat() - $startTime));
     }
     return $this->cellSet;
 }
 /**
  *
  * @return string
  */
 public function getMdxKeywords()
 {
     $metadataRequest = new XMLAMetadataRequest(XMLAMetadataRequest::DISCOVER_KEYWORDS);
     $context = new XMLAConnectionContext($this->xmlaConnection);
     $context->xmlaConnection = $this->xmlaConnection;
     $request = $this->xmlaConnection->generateRequest($context, $metadataRequest, array());
     $root = $this->xmlaConnection->executeMetadataRequest($request, $metadataRequest->isCachable());
     $keywords = array();
     foreach ($root->childNodes as $row) {
         $keyword = XMLAUtil::stringElement($row, 'Keyword');
         if (!empty($keyword)) {
             $keywords[] = $keyword;
         }
     }
     return implode(',', $keywords);
 }
Beispiel #16
0
 /**
  * @param $row
  * @param $name
  *
  * @return boolean
  */
 public static function booleanElement(DOMElement $row, $name)
 {
     return (bool) XMLAUtil::stringElement($row, $name);
 }