예제 #1
0
 public function testGetSelectors()
 {
     $this->assertEmpty($this->objLegend->getSelectors());
     $this->objLegend->addProperty('done');
     $this->assertArrayHasKey('done', $this->objLegend->getSelectors());
 }
예제 #2
0
 /**
  * Load definition from the dca
  *
  * @return $this;
  */
 protected function loadFromDefinition()
 {
     $arrDefinition = explode(';', $this->getDefinition());
     // go throw each legend
     foreach ($arrDefinition as $strLegend) {
         if ($strLegend == '') {
             continue;
         }
         $arrProperties = explode(',', $strLegend);
         // extract legend title and modifier
         preg_match('/\\{(.*)_legend(:hide)?\\}/', $arrProperties[0], $matches);
         array_shift($arrProperties);
         $objLegend = new Legend($matches[1], $this->getDataContainer(), $this);
         $this->arrLegends[$objLegend->getName()] = $objLegend;
         if (isset($matches[2])) {
             $objLegend->addModifier('hide');
         }
         // create each property
         foreach ($arrProperties as $strProperty) {
             if ($strProperty != '' && $this->getDataContainer()->hasProperty($strProperty)) {
                 $objLegend->addProperty($strProperty);
             }
         }
     }
     return $this;
 }