<?php
/*
* @package LabCMS
* @copyright (c) 2006 Alexander Levin aka Loki (loki_angel@mail.ru)
* @support http://labcms.ru
* @license http://opensource.org/licenses/gpl-license.php GNU Public License
*/

class bug_tracker_item_entity extends Entity
{
	public function __construct($data=null)
	{
		$this->_data['id']=&$this->_data['bug_id'];
		parent::__construct($data);
	}

	public function __set($k, $v)
	{
		parent::__set($k, $v);
		if ($k=='author' && $v) {
			$this->_data['author_id']=$this->_data['author']->id;
		}
		if ($k=='approver' && $v) {
			$this->_data['approver_id']=$this->_data['approver']->id;
		}
		if ($k=='performer' && $v) {
			$this->_data['performer_id']=$this->_data['performer']->id;
		}
		if ($k=='version' && $v) {
			$this->_data['version_id']=$this->_data['version']->id;
		}
	}
	
	public function getSubsribeId()
	{
		return 'bug_tracker_item_'.$this->id;
	}
}