Changeset 59141 for trunk/src/wp-includes/SimplePie/src/Category.php
- Timestamp:
- 09/30/2024 10:48:16 PM (2 months ago)
- Location:
- trunk/src/wp-includes/SimplePie/src
- Files:
-
- 1 added
- 1 moved
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 58 59 60 61 62 var$term;59 /** 60 * Category identifier 61 * 62 * @var string|null 63 * @see get_term 64 */ 65 public $term; 63 66 64 65 66 67 68 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 74 75 76 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 82 * 83 84 85 86 87 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 93 94 95 96 97 98 99 100 101 102 103 104 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 109 110 111 112 113 114 115 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 120 121 122 123 124 125 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 130 131 132 133 134 135 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 155 156 157 158 159 160 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.