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>;.
19 * @author Matthew Vita <matthewvita48@gmail.com>
20 * @link http://www.open-emr.org
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
;
34 * @Table(name="onotes")
35 * @Entity(repositoryClass="repositories\ONoteRepository")
39 * Default constructor.
41 public function __construct() {}
45 * @Column(name="id", type="integer")
46 * @GeneratedValue(strategy="AUTO")
51 * @Column(name="date", type="datetime")
56 * @Column(name="body", type="text")
61 * @Column(name="groupname", type="string", length=255)
66 * @ManyToOne(targetEntity="User")
67 * @JoinColumn(name="user", referencedColumnName="username")
72 * @Column(name="activity", type="integer", length=4)
76 public function getId() {
80 public function setId($value) {
84 public function getDate() {
88 public function setDate($value) {
92 public function getBody() {
96 public function setBody($value) {
100 public function getGroupName() {
101 return $this->groupName
;
104 public function setGroupName($value) {
105 $this->groupName
= $value;
108 public function getUser() {
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);