Ejemplo n.º 1
0
 /**
  * Write the extensions into the TCX.
  *
  * @param \XMLWriter $xmlWriter The XMLWriter.
  * @param ExtensionInterface[] $extensions The extensions to write.
  */
 protected function writeExtensions(\XMLWriter $xmlWriter, array $extensions)
 {
     foreach ($extensions as $extension) {
         switch ($extension::ID()) {
             case HR::ID():
                 $xmlWriter->startElement('HeartRateBpm');
                 $xmlWriter->writeElement('Value', (string) $extension->value());
                 $xmlWriter->endElement();
                 break;
         }
     }
 }
Ejemplo n.º 2
0
 /**
  * Test get the ID.
  */
 public function testGetID()
 {
     self::assertSame('HR', HR::ID());
 }
Ejemplo n.º 3
0
 /**
  * Write the extensions into the GPX.
  *
  * @param \XMLWriter $xmlWriter The XMLWriter.
  * @param ExtensionInterface[] $extensions The extensions to write.
  */
 protected function writeExtensions(\XMLWriter $xmlWriter, array $extensions)
 {
     $xmlWriter->startElement('extensions');
     foreach ($extensions as $extension) {
         switch ($extension::ID()) {
             case HR::ID():
                 $xmlWriter->startElementNs('gpxtpx', 'TrackPointExtension', null);
                 $xmlWriter->writeElementNs('gpxtpx', 'hr', null, (string) $extension->value());
                 $xmlWriter->endElement();
                 break;
         }
     }
     $xmlWriter->endElement();
 }