This repository has been archived on 2024-10-25. You can view files and clone it, but cannot push or open issues or pull requests.
Sequenzia/app/models/NoteVersion.php

30 lines
1.0 KiB
PHP
Raw Normal View History

2013-10-27 01:06:58 +02:00
<?php
class NoteVersion extends Rails\ActiveRecord\Base
{
public function toXml(array $options = array())
{
// {:created_at => created_at, :updated_at => updated_at, :creator_id => user_id, :x => x, :y => y, :width => width, :height => height, :is_active => is_active, :post_id => post_id, :body => body, :version => version}.to_xml(options.reverse_merge(:root => "note_version"))
}
public function asJson(array $args = array())
{
return json_encode(array(
'created_at' => $this->created_at,
'updated_at' => $this->updated_at,
'creator_id' => $this->user_id,
'x' => $this->x,
'y' => $this->y,
'width' => $this->width,
'height' => $this->height,
'is_active' => $this->is_active,
'post_id' => $this->post_id,
'body' => $this->body,
'version' => $this->version
));
}
public function author()
{
return User::find_name($this->user_id);
}
}