Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.0.x will end 8 May 2023 (12 months).
  • Bug fixes for security issues in 4.0.x will end 13 November 2023 (18 months).
  • PHP version: minimum PHP 7.3.0 Note: the minimum PHP version has increased since Moodle 3.10. PHP 7.4.x is also supported.
   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  }