Changeset 59141 for trunk/src/wp-includes/SimplePie/src/Category.php
- Timestamp:
- 09/30/2024 10:48:16 PM (18 months ago)
- Location:
- trunk/src/wp-includes/SimplePie/src
- Files:
-
- 1 added
- 1 moved
-
. (added)
-
Category.php (moved) (moved from trunk/src/wp-includes/SimplePie/Category.php) (3 diffs)
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/SimplePie/src/Category.php
r59140 r59141 1 1 <?php 2 2 3 /** 3 4 * SimplePie … … 6 7 * Takes the hard work out of managing a complete RSS/Atom solution. 7 8 * 8 * Copyright (c) 2004-20 16, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors9 * Copyright (c) 2004-2022, Ryan Parman, Sam Sneddon, Ryan McCue, and contributors 9 10 * All rights reserved. 10 11 * … … 42 43 */ 43 44 45 namespace SimplePie; 46 44 47 /** 45 48 * Manages all category-related data 46 49 * 47 * Used by {@see SimplePie_Item::get_category()} and {@see SimplePie_Item::get_categories()}50 * Used by {@see \SimplePie\Item::get_category()} and {@see \SimplePie\Item::get_categories()} 48 51 * 49 * This class can be overloaded with {@see SimplePie::set_category_class()}52 * This class can be overloaded with {@see \SimplePie\SimplePie::set_category_class()} 50 53 * 51 54 * @package SimplePie 52 55 * @subpackage API 53 56 */ 54 class SimplePie_Category57 class Category 55 58 { 56 /**57 * Category identifier58 *59 * @var string|null60 * @see get_term61 */62 var$term;59 /** 60 * Category identifier 61 * 62 * @var string|null 63 * @see get_term 64 */ 65 public $term; 63 66 64 /**65 * Categorization scheme identifier66 *67 * @var string|null68 * @see get_scheme()69 */70 var$scheme;67 /** 68 * Categorization scheme identifier 69 * 70 * @var string|null 71 * @see get_scheme() 72 */ 73 public $scheme; 71 74 72 /**73 * Human readable label74 *75 * @var string|null76 * @see get_label()77 */78 var$label;75 /** 76 * Human readable label 77 * 78 * @var string|null 79 * @see get_label() 80 */ 81 public $label; 79 82 80 /**81 * Category type82 * 83 * category for <category>84 * subject for <dc:subject>85 *86 * @var string|null87 * @see get_type()88 */89 var$type;83 /** 84 * Category type 85 * 86 * category for <category> 87 * subject for <dc:subject> 88 * 89 * @var string|null 90 * @see get_type() 91 */ 92 public $type; 90 93 91 /**92 * Constructor, used to input the data93 *94 * @param string|null $term95 * @param string|null $scheme96 * @param string|null $label97 * @param string|null $type98 */99 public function __construct($term = null, $scheme = null, $label = null, $type = null)100 {101 $this->term = $term;102 $this->scheme = $scheme;103 $this->label = $label;104 $this->type = $type;105 }94 /** 95 * Constructor, used to input the data 96 * 97 * @param string|null $term 98 * @param string|null $scheme 99 * @param string|null $label 100 * @param string|null $type 101 */ 102 public function __construct($term = null, $scheme = null, $label = null, $type = null) 103 { 104 $this->term = $term; 105 $this->scheme = $scheme; 106 $this->label = $label; 107 $this->type = $type; 108 } 106 109 107 /**108 * String-ified version109 *110 * @return string111 */112 public function __toString()113 {114 // There is no $this->data here115 return md5(serialize($this));116 }110 /** 111 * String-ified version 112 * 113 * @return string 114 */ 115 public function __toString() 116 { 117 // There is no $this->data here 118 return md5(serialize($this)); 119 } 117 120 118 /**119 * Get the category identifier120 *121 * @return string|null122 */123 public function get_term()124 {125 return $this->term;126 }121 /** 122 * Get the category identifier 123 * 124 * @return string|null 125 */ 126 public function get_term() 127 { 128 return $this->term; 129 } 127 130 128 /**129 * Get the categorization scheme identifier130 *131 * @return string|null132 */133 public function get_scheme()134 {135 return $this->scheme;136 }131 /** 132 * Get the categorization scheme identifier 133 * 134 * @return string|null 135 */ 136 public function get_scheme() 137 { 138 return $this->scheme; 139 } 137 140 138 /** 139 * Get the human readable label 140 * 141 * @param bool $strict 142 * @return string|null 143 */ 144 public function get_label($strict = false) 145 { 146 if ($this->label === null && $strict !== true) 147 { 148 return $this->get_term(); 149 } 150 return $this->label; 151 } 141 /** 142 * Get the human readable label 143 * 144 * @param bool $strict 145 * @return string|null 146 */ 147 public function get_label($strict = false) 148 { 149 if ($this->label === null && $strict !== true) { 150 return $this->get_term(); 151 } 152 return $this->label; 153 } 152 154 153 /**154 * Get the category type155 *156 * @return string|null157 */158 public function get_type()159 {160 return $this->type;161 }155 /** 156 * Get the category type 157 * 158 * @return string|null 159 */ 160 public function get_type() 161 { 162 return $this->type; 163 } 162 164 } 163 165 166 class_alias('SimplePie\Category', 'SimplePie_Category');
Note: See TracChangeset
for help on using the changeset viewer.