Skip to content

Instantly share code, notes, and snippets.

@igorw
Created February 8, 2010 18:52
Show Gist options
  • Select an option

  • Save igorw/298451 to your computer and use it in GitHub Desktop.

Select an option

Save igorw/298451 to your computer and use it in GitHub Desktop.
<?php
interface activity_item {
public function get_time();
public function get_message();
public function get_row(); // assoc array containing time, lang, args
}
class default_activity_item implements activity_item {
public function __construct($time, $lang, $args) {
$this->time = $time;
$this->lang = $lang;
$this->args = $args;
}
public function get_time() {
return $this->time;
}
public function get_message() {
return vsprintf(registry::$lang[$this->lang], $this->args);
}
public function get_row() {
return array('time' => $this->time, 'lang' => $this->lang, 'args' => serialize($this->args));
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment