class TagadelicTag in Tagadelic 8.3
Hierarchy
- class \Drupal\tagadelic\TagadelicTag
Expanded class hierarchy of TagadelicTag
5 files declare their use of TagadelicTag
- tagadelic.theme.inc in ./
tagadelic.theme.inc - Theme for tagadelic views.
- TagadelicCloudBase.php in src/
TagadelicCloudBase.php - TagadelicCloudInterface.php in src/
TagadelicCloudInterface.php - TagadelicCloudTaxonomy.php in src/
TagadelicCloudTaxonomy.php - TagadelicCloudView.php in src/
TagadelicCloudView.php
File
- src/
TagadelicTag.php, line 7
Namespace
Drupal\tagadelicView source
class TagadelicTag {
private $id = 0;
# Identifier of this tag
private $name = "";
# A human readable name for this tag.
private $description = "";
# A human readable piece of HTML-formatted text.
private $count = 1.0E-7;
# Absolute count for the weight. Weight, i.e. tag-size will be extracted from this.
private $weight = 0.0;
/**
* Initalize this tag
* @param id Integer the identifier of this tag
* @param name String a human readable name describing this tag
*/
function __construct($id, $name, $count) {
$this->id = $id;
$this->name = $name;
if ($count != 0) {
$this->count = $count;
}
}
/**
* Getter for the ID
* @ingroup getters
* return Integer Identifier
**/
public function getId() {
return $this->id;
}
/**
* Getter for the name
* @ingroup getters
* return String the human readable name
**/
public function getName() {
return $this->name;
return SafeMarkup::checkPlain($this->name);
}
/**
* Getter for the description
* @ingroup getters
* return String the human readable description
**/
public function getDescription() {
return SafeMarkup::checkPlain($this->description);
}
/**
* Returns the weight, getter only.
* @ingroup getters
* return Float the weight of this tag.
**/
public function getWeight() {
return $this->weight;
}
/**
* Returns the count, getter only.
* @ingroup getters
* return Int the count as provided when Initializing the Object.
**/
public function getCount() {
return $this->count;
}
/**
* Sets the optional description.
* A tag may have a description
* @param $description String a description
*/
public function setDescription($description) {
$this->description = $description;
}
/**
* setter for weight
* Operates on $this
* Returns $this
*/
public function setWeight($weight) {
$this->weight = $weight;
return $this;
}
/**
* Calculates a more evenly distributed value.
*/
public function distributed() {
return log($this->count);
}
}
Members
Name | Modifiers | Type | Description | Overrides |
---|---|---|---|---|
TagadelicTag:: |
private | property | ||
TagadelicTag:: |
private | property | ||
TagadelicTag:: |
private | property | ||
TagadelicTag:: |
private | property | ||
TagadelicTag:: |
private | property | ||
TagadelicTag:: |
public | function | Calculates a more evenly distributed value. | |
TagadelicTag:: |
public | function | Returns the count, getter only. return Int the count as provided when Initializing the Object. | |
TagadelicTag:: |
public | function | Getter for the description return String the human readable description | |
TagadelicTag:: |
public | function | Getter for the ID return Integer Identifier | |
TagadelicTag:: |
public | function | Getter for the name return String the human readable name | |
TagadelicTag:: |
public | function | Returns the weight, getter only. return Float the weight of this tag. | |
TagadelicTag:: |
public | function | Sets the optional description. A tag may have a description | |
TagadelicTag:: |
public | function | setter for weight Operates on $this Returns $this | |
TagadelicTag:: |
function | Initalize this tag |