Changeset 59141 for trunk/src/wp-includes/SimplePie/src/Restriction.php
- Timestamp:
- 09/30/2024 10:48:16 PM (8 months ago)
- Location:
- trunk/src/wp-includes/SimplePie/src
- Files:
-
- 1 added
- 1 moved
Legend:
- Unmodified
- Added
- Removed
-
trunk/src/wp-includes/SimplePie/src/Restriction.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 * Handles `<media:restriction>` as defined in Media RSS 46 49 * 47 * Used by {@see SimplePie_Enclosure::get_restriction()} and {@see SimplePie_Enclosure::get_restrictions()}50 * Used by {@see \SimplePie\Enclosure::get_restriction()} and {@see \SimplePie\Enclosure::get_restrictions()} 48 51 * 49 * This class can be overloaded with {@see SimplePie::set_restriction_class()}52 * This class can be overloaded with {@see \SimplePie\SimplePie::set_restriction_class()} 50 53 * 51 54 * @package SimplePie 52 55 * @subpackage API 53 56 */ 54 class SimplePie_Restriction57 class Restriction 55 58 { 56 57 58 59 60 61 62 var$relationship;59 /** 60 * Relationship ('allow'/'deny') 61 * 62 * @var string 63 * @see get_relationship() 64 */ 65 public $relationship; 63 66 64 65 66 67 68 69 70 var$type;67 /** 68 * Type of restriction 69 * 70 * @var string 71 * @see get_type() 72 */ 73 public $type; 71 74 72 73 74 75 76 77 78 var$value;75 /** 76 * Restricted values 77 * 78 * @var string 79 * @see get_value() 80 */ 81 public $value; 79 82 80 81 82 83 84 85 86 87 88 89 90 91 83 /** 84 * Constructor, used to input the data 85 * 86 * For documentation on all the parameters, see the corresponding 87 * properties and their accessors 88 */ 89 public function __construct($relationship = null, $type = null, $value = null) 90 { 91 $this->relationship = $relationship; 92 $this->type = $type; 93 $this->value = $value; 94 } 92 95 93 94 95 96 97 98 99 100 101 102 96 /** 97 * String-ified version 98 * 99 * @return string 100 */ 101 public function __toString() 102 { 103 // There is no $this->data here 104 return md5(serialize($this)); 105 } 103 106 104 /** 105 * Get the relationship 106 * 107 * @return string|null Either 'allow' or 'deny' 108 */ 109 public function get_relationship() 110 { 111 if ($this->relationship !== null) 112 { 113 return $this->relationship; 114 } 107 /** 108 * Get the relationship 109 * 110 * @return string|null Either 'allow' or 'deny' 111 */ 112 public function get_relationship() 113 { 114 if ($this->relationship !== null) { 115 return $this->relationship; 116 } 115 117 116 117 118 return null; 119 } 118 120 119 /** 120 * Get the type 121 * 122 * @return string|null 123 */ 124 public function get_type() 125 { 126 if ($this->type !== null) 127 { 128 return $this->type; 129 } 121 /** 122 * Get the type 123 * 124 * @return string|null 125 */ 126 public function get_type() 127 { 128 if ($this->type !== null) { 129 return $this->type; 130 } 130 131 131 132 132 return null; 133 } 133 134 134 /** 135 * Get the list of restricted things 136 * 137 * @return string|null 138 */ 139 public function get_value() 140 { 141 if ($this->value !== null) 142 { 143 return $this->value; 144 } 135 /** 136 * Get the list of restricted things 137 * 138 * @return string|null 139 */ 140 public function get_value() 141 { 142 if ($this->value !== null) { 143 return $this->value; 144 } 145 145 146 147 146 return null; 147 } 148 148 } 149 150 class_alias('SimplePie\Restriction', 'SimplePie_Restriction');
Note: See TracChangeset
for help on using the changeset viewer.