2 namespace Utility\Entity;
4 use Doctrine\ORM\Mapping as ORM;
11 * @ORM\HasLifecycleCallbacks
12 * @ORM\Table(name="lib_debug_log")
18 * Can archive records.
20 const ARCHIVE = false;
22 * Pull Synchronization Strategy for this table.
24 const PULL_SYNCH_STRATEGY = false;
26 * Push Synchronization Strategy for this table.
28 const PUSH_SYNCH_STRATEGY = false;
32 * @ORM\Column(type="integer");
33 * @ORM\GeneratedValue(strategy="AUTO")
38 * @ORM\Column(type="integer", nullable=true, name="profile_id")
43 * @ORM\Column(type="string", nullable=true, length=250, name="call_name")
48 * @ORM\Column(type="text", name="parameters")
53 * @ORM\Column(type="text", name="error_string")
55 protected $errorString;
58 * @ORM\Column(type="datetime");
64 * Magic getter to expose protected properties.
65 * @param string $property
68 public function __get($property)
70 return $this->$property;
74 * Magic setter to save protected properties.
75 * @param string $property
78 public function __set($property, $value)
80 $this->$property = $value;
86 public function setCreateTime()
88 $this->created = new \DateTime("now");
92 * Convert the object to an array.
93 * @param array $expand
94 * @param array $intersect
97 public function toArray(array $expand = array('attachment'), array $intersect = array())
99 $dateTimeFormat = \Utility\Registry::getConfigParam('DateTimeFormat');
100 $includeAll = empty($intersect);
102 ($includeAll || isset($intersect['id']))
103 && $data['id'] = $this->id;
104 ($includeAll || isset($intersect['userId']))
105 && $data['userId'] = $this->userId;
106 ($includeAll || isset($intersect['callName']))
107 && $data['callName'] = $this->callName;
108 ($includeAll || isset($intersect['params']))
109 && $data['params'] = !is_null($this->params)
110 ? unserialize($this->params)
112 ($includeAll || isset($intersect['errorString']))
113 && $data['errorString'] = $this->errorString;
114 ($includeAll || isset($intersect['created']))
115 && $data['created'] = !is_null($this->created)
116 ? $this->created->format($dateTimeFormat)
122 * Populate from an array.
125 public function fromArray($data = array())
128 && $this->id = $data['id'];
129 isset($data['userId'])
130 && $this->userId = $data['userId'];
131 isset($data['callName'])
132 && $this->callName = $data['callName'];
133 isset($data['emailBody'])
134 && $this->emailBody = $data['emailBody'];
135 isset($data['params']) && is_array($data['params'])
136 && $this->params = serialize($data['params']);
137 isset($data['errorString'])
138 && $this->errorString = $data['errorString'];