_xml; } /** * Singleton, return instance of class * * @access public * @return CreateChartRels */ public static function getInstance() { if (self::$_instance == NULL) { self::$_instance = new CreateChartRels(); } return self::$_instance; } /** * Create relationship document to use in DOCX file * * @access public * @param int $idChart */ public function createRelationship($idChart) { $this->generateRELATIONSHIPS(); $this->generateRELATIONSHIP($idChart); $this->cleanTemplate(); } /** * New relationship, added to relationships XML * * @access protected * @param int $idChart * @param int $id. Optional, use 1 as default */ protected function generateRELATIONSHIP($idChart, $id = 1) { $xml = '__GENERATECHARTSPACE__'; $tag = '__GENERATERELATIONSHIPS__'; $this->_xml = str_replace($tag, $xml, $this->_xml); } /** * Main tags of relationships XML * * @access protected */ protected function generateRELATIONSHIPS() { $this->_xml = '' . '__GENERATERELATIONSHIPS__' . ''; } }