. */ namespace Volkszaehler\Model; use Doctrine\Common\Collections\ArrayCollection; /** * Data entity * * @author Steffen Vogel * @package default * * @Entity * @Table(name="data") */ class Data { /** * ending timestamp of period in ms since 1970 * * @Id * @Column(type="bigint") */ protected $timestamp; /** * @Column(type="decimal", precision="10", scale="5") * @todo change to float after DCC-67 has been closed */ protected $value; /** * @Id * @ManyToOne(targetEntity="Channel", inversedBy="data") * @JoinColumn(name="channel_id", referencedColumnName="id") */ protected $channel; public function __construct(Channel\Channel $channel, $value, $timestamp) { $this->channel = $channel; $this->value = $value; $this->timestamp = $timestamp; } /** * setter & getter */ public function getValue() { return $this->value; } public function getTimestamp() { return $this->timestamp; } public function getChannel() { return $this->channel; } } ?>