[ Index ]

PHP Cross Reference of Joomla 4.2.2 documentation

title

Body

[close]

/libraries/src/Feed/ -> FeedLink.php (source)

   1  <?php
   2  
   3  /**
   4   * Joomla! Content Management System
   5   *
   6   * @copyright  (C) 2012 Open Source Matters, Inc. <https://www.joomla.org>
   7   * @license    GNU General Public License version 2 or later; see LICENSE.txt
   8   */
   9  
  10  namespace Joomla\CMS\Feed;
  11  
  12  // phpcs:disable PSR1.Files.SideEffects
  13  \defined('JPATH_PLATFORM') or die;
  14  // phpcs:enable PSR1.Files.SideEffects
  15  
  16  /**
  17   * Feed Link class.
  18   *
  19   * @since  3.1.4
  20   */
  21  class FeedLink
  22  {
  23      /**
  24       * The URI to the linked resource.
  25       *
  26       * @var    string
  27       * @since  3.1.4
  28       */
  29      public $uri;
  30  
  31      /**
  32       * The relationship between the feed and the linked resource.
  33       *
  34       * @var    string
  35       * @since  3.1.4
  36       */
  37      public $relation;
  38  
  39      /**
  40       * The resource type.
  41       *
  42       * @var    string
  43       * @since  3.1.4
  44       */
  45      public $type;
  46  
  47      /**
  48       * The language of the resource found at the given URI.
  49       *
  50       * @var    string
  51       * @since  3.1.4
  52       */
  53      public $language;
  54  
  55      /**
  56       * The title of the resource.
  57       *
  58       * @var    string
  59       * @since  3.1.4
  60       */
  61      public $title;
  62  
  63      /**
  64       * The length of the resource in bytes.
  65       *
  66       * @var    integer
  67       * @since  3.1.4
  68       */
  69      public $length;
  70  
  71      /**
  72       * Constructor.
  73       *
  74       * @param   string   $uri       The URI to the linked resource.
  75       * @param   string   $relation  The relationship between the feed and the linked resource.
  76       * @param   string   $type      The resource type.
  77       * @param   string   $language  The language of the resource found at the given URI.
  78       * @param   string   $title     The title of the resource.
  79       * @param   integer  $length    The length of the resource in bytes.
  80       *
  81       * @since   3.1.4
  82       * @throws  \InvalidArgumentException
  83       */
  84      public function __construct($uri = null, $relation = null, $type = null, $language = null, $title = null, $length = null)
  85      {
  86          $this->uri = $uri;
  87          $this->relation = $relation;
  88          $this->type = $type;
  89          $this->language = $language;
  90          $this->title = $title;
  91  
  92          // Validate the length input.
  93          if (isset($length) && !is_numeric($length)) {
  94              throw new \InvalidArgumentException('Length must be numeric.');
  95          }
  96  
  97          $this->length = (int) $length;
  98      }
  99  }


Generated: Wed Sep 7 05:41:13 2022 Chilli.vc Blog - For Webmaster,Blog-Writer,System Admin and Domainer