Search moodle.org's
Developer Documentation

See Release Notes
Long Term Support Release

  • Bug fixes for general core bugs in 3.9.x will end* 10 May 2021 (12 months).
  • Bug fixes for security issues in 3.9.x will end* 8 May 2023 (36 months).
  • PHP version: minimum PHP 7.2.0 Note: minimum PHP version has increased since Moodle 3.8. PHP 7.3.x and 7.4.x are supported too.
   1  <?php
   2  /**
   3   * Copyright 2012-2017 Horde LLC (http://www.horde.org/)
   4   *
   5   * See the enclosed file LICENSE for license information (BSD). If you
   6   * did not receive this file, see http://www.horde.org/licenses/bsd.
   7   *
   8   * @category  Horde
   9   * @copyright 2012-2017 Horde LLC
  10   * @license   http://www.horde.org/licenses/bsd New BSD License
  11   * @package   Mail
  12   */
  13  
  14  /**
  15   * Container object for a collection of group addresses.
  16   *
  17   * @author    Michael Slusarz <slusarz@horde.org>
  18   * @category  Horde
  19   * @copyright 2012-2017 Horde LLC
  20   * @license   http://www.horde.org/licenses/bsd New BSD License
  21   * @package   Mail
  22   */
  23  class Horde_Mail_Rfc822_GroupList extends Horde_Mail_Rfc822_List
  24  {
  25      /**
  26       * Add objects to the container.
  27       *
  28       * @param mixed $obs  A RFC 822 object (or list of objects) to store in
  29       *                    this object.
  30       */
  31      public function add($obs)
  32      {
  33          if ($obs instanceof Horde_Mail_Rfc822_Object) {
  34              $obs = array($obs);
  35          }
  36  
  37          foreach ($obs as $val) {
  38              /* Only allow addresses. */
  39              if ($val instanceof Horde_Mail_Rfc822_Address) {
  40                  parent::add($val);
  41              }
  42          }
  43      }
  44  
  45      /**
  46       * Group count.
  47       *
  48       * @return integer  The number of groups in the list.
  49       */
  50      public function groupCount()
  51      {
  52          return 0;
  53      }
  54  
  55  }