예제 #1
0
파일: Server.php 프로젝트: kleitz/bzion
 /**
  * Checks if the last update is older than or equal to the update interval
  * @return bool Whether the information is older than the update interval
  */
 public function staleInfo()
 {
     $update_time = $this->updated->copy();
     $update_time->modify(Service::getParameter('bzion.miscellaneous.update_interval'));
     return TimeDate::now() >= $update_time;
 }
예제 #2
0
 /**
  * Get the time when the conversation was most recently active
  *
  * @return TimeDate
  */
 public function getLastActivity()
 {
     return $this->last_activity->copy();
 }
예제 #3
0
파일: Match.php 프로젝트: allejo/bzion
 /**
  * Get the timestamp of the last update of the match
  *
  * @return TimeDate The match's update timestamp
  */
 public function getUpdated()
 {
     return $this->updated->copy();
 }
예제 #4
0
파일: Team.php 프로젝트: allejo/bzion
 /**
  * Get the creation date of the team
  *
  * @return TimeDate The creation date of the team
  */
 public function getCreationDate()
 {
     return $this->created->copy();
 }
예제 #5
0
파일: Invitation.php 프로젝트: allejo/bzion
 /**
  * Get the time when the invitation will expire
  *
  * @return TimeDate
  */
 public function getExpiration()
 {
     return $this->expiration->copy();
 }
예제 #6
0
파일: Player.php 프로젝트: allejo/bzion
 /**
  * Check whether or not a player been in a match or has logged on in the specified amount of time to be considered
  * active
  *
  * @return bool True if the player has been active
  */
 public function hasBeenActive()
 {
     $this->lazyLoad();
     $interval = Service::getParameter('bzion.miscellaneous.active_interval');
     $lastLogin = $this->last_login->copy()->modify($interval);
     $hasBeenActive = TimeDate::now() <= $lastLogin;
     if ($this->last_match->isValid()) {
         $lastMatch = $this->last_match->getTimestamp()->copy()->modify($interval);
         $hasBeenActive = $hasBeenActive || TimeDate::now() <= $lastMatch;
     }
     return $hasBeenActive;
 }
예제 #7
0
파일: Timestamp.php 프로젝트: allejo/bzion
 /**
  * Get a copy of the timestamp of the Model
  *
  * @return \TimeDate
  */
 public function getTimestamp()
 {
     return $this->timestamp->copy();
 }
예제 #8
0
파일: News.php 프로젝트: allejo/bzion
 /**
  * Get the time when the article was last updated
  *
  * @return TimeDate The article's last update time
  */
 public function getLastEdit()
 {
     return $this->updated->copy();
 }
예제 #9
0
파일: Page.php 프로젝트: allejo/bzion
 /**
  * Get the time when the page was last updated
  * @return TimeDate
  */
 public function getUpdated()
 {
     $this->lazyLoad();
     return $this->updated->copy();
 }