Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 3.11.x will end 14 Nov 2022 (12 months plus 6 months extension).
  • Bug fixes for security issues in 3.11.x will end 13 Nov 2023 (18 months plus 12 months extension).
  • PHP version: minimum PHP 7.3.0 Note: minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is supported too.
   1  <?php namespace RedeyeVentures\GeoPattern\SVGElements;
   2  
   3  class Group extends Base
   4  {
   5      protected $tag = 'g';
   6      protected $items;
   7  
   8      function __construct($items=array(), $args=array())
   9      {
  10          $this->items = $items;
  11          $this->args = $args;
  12      }
  13  
  14      function addItem($item)
  15      {
  16          $this->items[] = $item;
  17          return $this;
  18      }
  19  
  20      function setArgs($args)
  21      {
  22          $this->args = $args;
  23          return $this;
  24      }
  25  
  26      function getString()
  27      {
  28          $svgString = '';
  29          $svgString .= "<{$this->tag} {$this->argsToString($this->args)}>";
  30          foreach ($this->items as $item)
  31          {
  32              $svgString .= $item;
  33          }
  34          $svgString .= "</{$this->tag}>";
  35  
  36          return $svgString;
  37      }
  38  }