Search moodle.org's
Developer Documentation

See Release Notes

  • Bug fixes for general core bugs in 4.3.x will end 7 October 2024 (12 months).
  • Bug fixes for security issues in 4.3.x will end 21 April 2025 (18 months).
  • PHP version: minimum PHP 8.0.0 Note: minimum PHP version has increased since Moodle 4.1. PHP 8.2.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  }