Highway to PSR2
[openemr.git] / entities / ONote.php
blob8557558c8ee280b400d1eff73ca83cf5a12e282d
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
39 /**
40 * Default constructor.
42 public function __construct()
46 /**
47 * @Id
48 * @Column(name="id", type="integer")
49 * @GeneratedValue(strategy="AUTO")
51 private $id;
53 /**
54 * @Column(name="date", type="datetime")
56 private $date;
58 /**
59 * @Column(name="body", type="text")
61 private $body;
63 /**
64 * @Column(name="groupname", type="string", length=255)
66 private $groupName;
68 /**
69 * @ManyToOne(targetEntity="User")
70 * @JoinColumn(name="user", referencedColumnName="username")
72 private $user;
74 /**
75 * @Column(name="activity", type="integer", length=4)
77 private $activity;
79 public function getId()
81 return $this->id;
84 public function setId($value)
86 $this->id = $value;
89 public function getDate()
91 return $this->date;
94 public function setDate($value)
96 $this->date = $value;
99 public function getBody()
101 return $this->body;
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()
121 return $this->user;
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);