コード例 #1
0
 public function __construct(XMLALevel $level, $uniqueName, $name, $caption, $description, $parentMemberUniqueName, $aggregator, $datatype, $visible, $ordinal)
 {
     parent::__construct($level, $uniqueName, $name, $caption, $description, $parentMemberUniqueName, $aggregator == Aggregator::getEnum(Aggregator::CALCULATED) ? MemberType::getEnum(MemberType::FORMULA) : MemberType::getEnum(MemberType::MEASURE), 0, $ordinal, array());
     assert($level->getHierarchy()->getDimension()->getDimensionType() == DimensionType::getEnum(DimensionType::MEASURE));
     $this->aggregator = $aggregator;
     $this->datatype = $datatype;
     $this->visible = $visible;
 }
コード例 #2
0
 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;
 }
コード例 #3
0
 /**
  * Looks up a member by its unique name.
  *
  * @param string $memberUniqueName Unique name of member
  *
  * @return XMLAMember, or null if not found
  * @throws OLAPException if error occurs
  */
 public function lookupMemberByUniqueName($memberUniqueName)
 {
     // First, look in measures map.
     if (isset($this->measureMap[$memberUniqueName])) {
         return $this->measureMap[$memberUniqueName];
     }
     // Next, look in the member cache.
     if (isset($this->memberMap[$memberUniqueName])) {
         return $this->memberMap[$memberUniqueName];
     }
     // Next, pass the lookup up the reader composition
     $member = parent::lookupMemberByUniqueName($memberUniqueName);
     if ($member != null && $member->getDimension()->getDimensionType() !== DimensionType::getEnum(DimensionType::MEASURE)) {
         $this->memberMap[$memberUniqueName] = $member;
     }
     return $member;
 }
コード例 #4
0
ファイル: XMLALevel.php プロジェクト: karlossgarcia/olap4php
 /**
  * Constructor
  *
  * @param XMLAHierarchy $hierarchy
  * @param string        $uniqueName  Unique name
  * @param string        $name        Name
  * @param string        $caption     Caption
  * @param string        $description Description
  * @param integer       $depth       Distance to root
  * @param LevelType     $type        Level type
  * @param boolean       $calculated  Whether level is calculated
  * @param integer       $cardinality Number of members in this level
  */
 public function __construct(XMLAHierarchy $hierarchy, $uniqueName, $name, $caption, $description, $depth, LevelType $type = NULL, $calculated, $cardinality)
 {
     parent::__construct($uniqueName, $name, $caption, $description);
     assert($hierarchy != null);
     $this->type = $type;
     $this->calculated = $calculated;
     $this->cardinality = $cardinality;
     $this->depth = $depth;
     $this->hierarchy = $hierarchy;
     $levelRestrictions = array("CATALOG_NAME" => $hierarchy->getDimension()->getCube()->getSchema()->getCatalog()->getName(), "SCHEMA_NAME" => $hierarchy->getDimension()->getCube()->getSchema()->getName(), "CUBE_NAME" => $hierarchy->getDimension()->getCube()->getName(), "DIMENSION_UNIQUE_NAME" => $hierarchy->getDimension()->getUniqueName(), "HIERARCHY_UNIQUE_NAME" => $hierarchy->getUniqueName(), "LEVEL_UNIQUE_NAME" => $this->getUniqueName());
     $this->propertyList = new LazyMetadataList(new XMLAMetadataRequest(XMLAMetadataRequest::MDSCHEMA_PROPERTIES), XMLAConnectionContext::createAtLevel($this), new XMLAPropertyHandler(), $levelRestrictions);
     try {
         if ($hierarchy->getDimension()->getDimensionType() == DimensionType::getEnum(DimensionType::MEASURE)) {
             $restrictions = array("CATALOG_NAME" => $hierarchy->getDimension()->getCube()->getSchema()->getCatalog()->getName(), "SCHEMA_NAME" => $hierarchy->getDimension()->getCube()->getSchema()->getName(), "CUBE_NAME" => $hierarchy->getDimension()->getCube()->getName());
             $this->memberList = new LazyMetadataList(new XMLAMetadataRequest(XMLAMetadataRequest::MDSCHEMA_MEASURES), new XMLAConnectionContext($hierarchy->getDimension()->getCube()->getSchema()->getCatalog()->getMetadata()->getConnection(), $hierarchy->getDimension()->getCube()->getSchema()->getCatalog()->getMetadata(), $hierarchy->getDimension()->getCube()->getSchema()->getCatalog(), $hierarchy->getDimension()->getCube()->getSchema(), $hierarchy->getDimension()->getCube(), $hierarchy->getDimension(), $hierarchy, $this), new XMLAMeasureHandler($hierarchy->getDimension(), $restrictions));
         } else {
             $this->memberList = new LazyMetadataList(new XMLAMetadataRequest(XMLAMetadataRequest::MDSCHEMA_MEMBERS), new XMLAConnectionContext($hierarchy->getDimension()->getCube()->getSchema()->getCatalog()->getMetadata()->getConnection(), $hierarchy->getDimension()->getCube()->getSchema()->getCatalog()->getMetadata(), $hierarchy->getDimension()->getCube()->getSchema()->getCatalog(), $hierarchy->getDimension()->getCube()->getSchema(), $hierarchy->getDimension()->getCube(), $hierarchy->getDimension(), $hierarchy, $this), new XMLAMemberHandler(), $levelRestrictions);
         }
     } catch (OlapException $e) {
         throw new RuntimeException("Programming error", $e);
     }
 }