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
   2  /**
   3   * Copyright 2014-2017 Horde LLC (http://www.horde.org/)
   4   *
   5   * See the enclosed file LICENSE for license information (LGPL). If you
   6   * did not receive this file, see http://www.horde.org/licenses/lgpl21.
   7   *
   8   * @category  Horde
   9   * @copyright 2014-2017 Horde LLC
  10   * @license   http://www.horde.org/licenses/lgpl21 LGPL 2.1
  11   * @package   Mime
  12   */
  13  
  14  /**
  15   * Interface representing a single named header element that can appear
  16   * multiple times in a message part.
  17   *
  18   * @author    Michael Slusarz <slusarz@horde.org>
  19   * @category  Horde
  20   * @copyright 2014-2017 Horde LLC
  21   * @license   http://www.horde.org/licenses/lgpl21 LGPL 2.1
  22   * @package   Mime
  23   * @since     2.5.0
  24   *
  25   * @property-read array $full_value  List of full header values (strings).
  26   * @property-read array $value  List of header values (strings).
  27   */
  28  class Horde_Mime_Headers_Element_Multiple
  29  extends Horde_Mime_Headers_Element
  30  {
  31      /**
  32       */
  33      public function __get($name)
  34      {
  35          switch ($name) {
  36          case 'full_value':
  37          case 'value':
  38              return $this->_values;
  39          }
  40  
  41          return parent::__get($name);
  42      }
  43  
  44      /**
  45       */
  46      protected function _setValue($value)
  47      {
  48          if ($value instanceof Horde_Mime_Headers_Element) {
  49              $value = $value->value;
  50          }
  51  
  52          foreach ((is_array($value) ? $value : array($value)) as $val) {
  53              $this->_values[] = $this->_sanityCheck(Horde_Mime::decode($val));
  54          }
  55      }
  56  
  57  }