Index: trunk/extensions/CodeReview/backend/CodeSignoff.php |
— | — | @@ -0,0 +1,21 @@ |
| 2 | +<?php |
| 3 | +class CodeSignoff { |
| 4 | + public $rev, $user, $flag, $timestamp; |
| 5 | + |
| 6 | + public function __construct( $rev, $user, $flag, $timestamp ) { |
| 7 | + $this->rev = $rev; |
| 8 | + $this->user = $user; |
| 9 | + $this->flag = $flag; |
| 10 | + $this->timestamp = $timestamp; |
| 11 | + } |
| 12 | + |
| 13 | + public static function newFromRow( $rev, $row ) { |
| 14 | + return self::newFromData( $rev, get_object_vars( $row ) ); |
| 15 | + } |
| 16 | + |
| 17 | + public static function newFromData( $rev, $data ) { |
| 18 | + return new self( $rev, $data['cs_user_text'], $data['cs_flag'], |
| 19 | + wfTimestamp( TS_MW, $data['cs_timestamp'] ) |
| 20 | + ); |
| 21 | + } |
| 22 | +} |