3 * Chart tracker entity.
5 * Copyright (C) 2017 Victor Kofia <victor.kofia@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 Victor Kofia <victor.kofia@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
;
31 * @Table(name="chart_tracker")
32 * @Entity(repositoryClass="repositories\ChartTrackerRepository")
37 * Default constructor.
39 public function __construct(){
45 * @Column(name="ct_pid"), type="int", length=11, nullable=false, options={"default" : 0})
50 * @Column(name="ct_when", type="datetime", nullable=false)
55 * @Column(name="ct_userid"), type="bigint", length=20, nullable=false, options={"default" : 0})
60 * @Column(name="ct_location"), type="varchar", length=31, nullable=false, options={"default" : "")
70 public function getPid() {
79 public function setPid($value) {
86 * return when datetime
88 public function getWhen() {
95 * @param when datetime
97 public function setWhen($value) {
102 * Getter for user id.
104 * return user id number
106 public function getUserId() {
107 return $this->userId
;
111 * Setter for user id.
113 * @param user id number
115 public function setUserId($value) {
116 $this->userId
= $value;
120 * Getter for location.
122 * return location string
124 public function getLocation() {
125 return $this->location
;
129 * Setter for location.
131 * @param location string
133 public function setLocation($value) {
134 $this->location
= $value;
138 * ToString of the entire object.
140 * @return object as string
142 public function __toString() {
143 return "pid: '" . $this->getPid() . "' " .
144 "date: '" . $this->getDate() . "' " .
145 "userId: '" . $this->getUserId() . "' " .
146 "location" . $this->getLocation() . "' " ;
150 * ToSerializedObject of the entire object.
152 * @return object as serialized object.
154 public function toSerializedObject() {
155 return get_object_vars($this);