<?php
require_once 'DataSnapshot.php';
final class Data extends DataSnapshot
{
private $_comment;
public function __construct()
{
$this->_comment = array();
}
public function takeSnapshot()
{
return new DataSnapshot($this->_comment);
}
public function restoreSnapshot(DataSnapshot $snapshot)
{
$this->_comment = $snapshot->getComment();
}
public function addComment($comment)
{
$this->_comment[] = $comment;
}
public function getComment()
{
return $this->_comment;
}
}