Overview

Namespaces

  • NGS
    • Client
      • Exception
    • Converter
    • Patterns
  • PHP

Classes

  • AggregateDomainEvent
  • AggregateRoot
  • CubeBuilder
  • DomainEvent
  • GenericSearch
  • Identifiable
  • OlapCube
  • Repository
  • Search
  • Searchable
  • SearchBuilder
  • Snapshot
  • Specification
  • Templater

Interfaces

  • IDomainObject
  • IIdentifiable
  • Overview
  • Namespace
  • Class
  • Tree
 1: <?php
 2: namespace NGS\Patterns;
 3: 
 4: require_once(__DIR__.'/../Client/RestHttp.php');
 5: require_once(__DIR__.'/../Client/StandardProxy.php');
 6: require_once(__DIR__.'/Specification.php');
 7: require_once(__DIR__.'/CubeBuilder.php');
 8: 
 9: use \NGS\Client\RestHttp;
10: use \NGS\Client\StandardProxy;
11: use \NGS\Patterns\Specification;
12: use \NGS\Patterns\CubeBuilder;
13: 
14: abstract class OlapCube
15: {
16:     /**
17:      * @var \Ngs\Client\RestHttp
18:      */
19:     protected $restHttp;
20: 
21:     /**
22:      * @return array Get available dimensions
23:      */
24:     public abstract function getDimensions();
25: 
26:     /**
27:      * @return array Get available facts
28:      */
29:     public abstract function getFacts();
30: 
31:     /**
32:      * Constructs object using target server proxy
33:      *
34:      * @param \NGS\Client\RestHttp|void $restHttp to target server used for analysis
35:      */
36:     public function __construct(RestHttp $restHttp = null)
37:     {
38:         if ($restHttp === null) {
39:             $restHttp = RestHttp::instance();
40:         }
41:         $this->restHttp = $restHttp;
42:     }
43: 
44:     public function builder()
45:     {
46:         return new CubeBuilder($this);
47:     }
48: 
49:     /**
50:      * Populate cube
51:      *
52:      * @return \NGS\Patterns\OlapCube Populated cube object
53:      */
54:     public function analyze(
55:         array $dimensions,
56:         array $facts = array(),
57:         array $order = array(),
58:         Specification $specification = null)
59:     {
60:         $proxy = new StandardProxy($this->restHttp);
61:         return $specification === null
62:             ? $proxy->olapCube($this, $dimensions, $facts, $order)
63:             : $proxy->olapCubeWithSpecification($this, $specification, $dimensions, $facts, $order);
64:     }
65: }
66: 
API documentation generated by ApiGen 2.8.0