Practices gui - bootstrap light, no pure php in smarty, html escaping in smarty ...
[openemr.git] / entities / ONote.php
blob7b10733c30bc59ea85683b279bb22a5c1855df46
1 <?php
2 /**
3 * Office note entity.
5 * Copyright (C) 2017 Matthew Vita <matthewvita48@gmail.com>
7 * LICENSE: This program is free software; you can redistribute it and/or
8 * modify it under the terms of the GNU General Public License
9 * as published by the Free Software Foundation; either version 2
10 * of the License, or (at your option) any later version.
11 * This program is distributed in the hope that it will be useful,
12 * but WITHOUT ANY WARRANTY; without even the implied warranty of
13 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14 * GNU General Public License for more details.
15 * You should have received a copy of the GNU General Public License
16 * along with this program. If not, see <http://opensource.org/licenses/gpl-license.php>;.
18 * @package OpenEMR
19 * @author Matthew Vita <matthewvita48@gmail.com>
20 * @link http://www.open-emr.org
23 namespace entities;
25 use Doctrine\ORM\Mapping\Entity;
26 use Doctrine\ORM\Mapping\Table;
27 use Doctrine\ORM\Mapping\Column;
28 use Doctrine\ORM\Mapping\Id;
29 use Doctrine\ORM\Mapping\ManyToOne;
30 use Doctrine\ORM\Mapping\JoinColumn ;
31 use Doctrine\ORM\Mapping\GeneratedValue;
33 /**
34 * @Table(name="onotes")
35 * @Entity(repositoryClass="repositories\ONoteRepository")
37 class ONote {
38 /**
39 * Default constructor.
41 public function __construct() {}
43 /**
44 * @Id
45 * @Column(name="id", type="integer")
46 * @GeneratedValue(strategy="AUTO")
48 private $id;
50 /**
51 * @Column(name="date", type="datetime")
53 private $date;
55 /**
56 * @Column(name="body", type="text")
58 private $body;
60 /**
61 * @Column(name="groupname", type="string", length=255)
63 private $groupName;
65 /**
66 * @ManyToOne(targetEntity="User")
67 * @JoinColumn(name="user", referencedColumnName="username")
69 private $user;
71 /**
72 * @Column(name="activity", type="integer", length=4)
74 private $activity;
76 public function getId() {
77 return $this->id;
80 public function setId($value) {
81 $this->id = $value;
84 public function getDate() {
85 return $this->date;
88 public function setDate($value) {
89 $this->date = $value;
92 public function getBody() {
93 return $this->body;
96 public function setBody($value) {
97 $this->body = $value;
100 public function getGroupName() {
101 return $this->groupName;
104 public function setGroupName($value) {
105 $this->groupName = $value;
108 public function getUser() {
109 return $this->user;
112 public function setUser($value) {
113 $this->user = $value;
116 public function getActivity() {
117 return $this->activity;
120 public function setActivity($value) {
121 $this->activity = $value;
125 * ToString of the entire object.
127 * @return object as string
129 public function __toString() {
130 return "id: '" . $this->getId() . "' " .
131 "date: '" . $this->getDate()->format('Y-m-d H:i:s') . "' " .
132 "activity: '" . $this->getActivity() . "' " .
133 "groupname: '" . $this->getGroupName() . "' " .
134 "body: '" . $this->getBody() . "' ";
138 * ToSerializedObject of the entire object.
140 * @return object as serialized object.
142 public function toSerializedObject() {
143 return get_object_vars($this);