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
23 namespace OpenEMR\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
;
34 * @Table(name="onotes")
35 * @Entity(repositoryClass="OpenEMR\Repositories\ONoteRepository")
40 * Default constructor.
42 public function __construct()
48 * @Column(name="id", type="integer")
49 * @GeneratedValue(strategy="AUTO")
54 * @Column(name="date", type="datetime")
59 * @Column(name="body", type="text")
64 * @Column(name="groupname", type="string", length=255)
69 * @ManyToOne(targetEntity="User")
70 * @JoinColumn(name="user", referencedColumnName="username")
75 * @Column(name="activity", type="integer", length=4)
79 public function getId()
84 public function setId($value)
89 public function getDate()
94 public function setDate($value)
99 public function getBody()
104 public function setBody($value)
106 $this->body
= $value;
109 public function getGroupName()
111 return $this->groupName
;
114 public function setGroupName($value)
116 $this->groupName
= $value;
119 public function getUser()
124 public function setUser($value)
126 $this->user
= $value;
129 public function getActivity()
131 return $this->activity
;
134 public function setActivity($value)
136 $this->activity
= $value;
140 * ToString of the entire object.
142 * @return object as string
144 public function __toString()
146 return "id: '" . $this->getId() . "' " .
147 "date: '" . $this->getDate()->format('Y-m-d H:i:s') . "' " .
148 "activity: '" . $this->getActivity() . "' " .
149 "groupname: '" . $this->getGroupName() . "' " .
150 "body: '" . $this->getBody() . "' ";
154 * ToSerializedObject of the entire object.
156 * @return object as serialized object.
158 public function toSerializedObject()
160 return get_object_vars($this);