◆ __construct()
BanEntry constructor.
- Parameters
-
43 $this->name = strtolower($name);
44 $this->creationDate = new \DateTime();
◆ fromString()
static fromString |
( |
|
$str | ) |
|
|
static |
- Parameters
-
- Returns
- BanEntry
143 if(strlen($str) < 2){
146 $str = explode(
"|", trim($str));
147 $entry =
new BanEntry(trim(array_shift($str)));
149 $datetime = \DateTime::createFromFormat(self::$format, array_shift($str));
150 if(!($datetime instanceof \DateTime)){
151 MainLogger::getLogger()->alert(
"Error parsing date for BanEntry for player \"" . $entry->getName() .
"\", the format may be invalid!");
154 $entry->setCreated($datetime);
156 $entry->setSource(trim(array_shift($str)));
158 $expire = trim(array_shift($str));
159 if(strtolower($expire) !==
"forever" and strlen($expire) > 0){
160 $entry->setExpires(\DateTime::createFromFormat(self::$format, $expire));
163 $entry->setReason(trim(array_shift($str)));
◆ getCreated()
- Returns
58 return $this->creationDate;
◆ getExpires()
- Returns
86 return $this->expirationDate;
◆ getName()
◆ getReason()
- Returns
- string
109 return $this->reason;
◆ getSource()
◆ getString()
- Returns
- string
126 $str .= $this->
getCreated()->format(self::$format);
◆ hasExpired()
- Returns
- bool
100 $now = new \DateTime();
102 return $this->expirationDate === null ? false : $this->expirationDate < $now;
◆ setCreated()
setCreated |
( |
\DateTime |
$date | ) |
|
- Parameters
-
65 $this->creationDate = $date;
◆ setExpires()
- Parameters
-
93 $this->expirationDate = $date;
◆ setReason()
- Parameters
-
116 $this->reason = $reason;
◆ setSource()
- Parameters
-
79 $this->source = $source;
◆ $format
$format = "Y-m-d H:i:s O" |
|
static |
The documentation for this class was generated from the following file:
- src/pocketmine/permission/BanEntry.php