Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Commit 2fe68f6

Browse files
Created basic entity class, populated BugReport class with getters and setters
1 parent 3784e43 commit 2fe68f6

File tree

3 files changed

+137
-0
lines changed

3 files changed

+137
-0
lines changed
Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
<?php
2+
3+
4+
namespace App\Contracts;
5+
6+
7+
interface RepositoryInterface
8+
{
9+
10+
}

‎src/Entity/BugReport.php‎

Lines changed: 116 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,116 @@
1+
<?php
2+
namespace App\Entity;
3+
4+
class BugReport extends Entity
5+
{
6+
private $id;
7+
private $report_type;
8+
private $email;
9+
private $link;
10+
private $message;
11+
private $created_at;
12+
13+
public function getId(): int
14+
{
15+
return $this->id;
16+
}
17+
18+
public function toArray(): array
19+
{
20+
return [
21+
'report_type' => $this->getReportType(),
22+
'email' => $this->getEmail(),
23+
'message' => $this->getMessage(),
24+
'link' => $this->getLink(),
25+
'created_at' => date('Y-m-d H:i:s'),
26+
];
27+
}
28+
29+
30+
//------------------------------------------- Getters and Setters ---------------------------------//
31+
32+
public function getCreatedAt()
33+
{
34+
return $this->created_at;
35+
}
36+
37+
38+
/**
39+
* @return mixed
40+
*/
41+
public function getReportType()
42+
{
43+
return $this->report_type;
44+
}
45+
46+
47+
/**
48+
* @param mixed $report_type
49+
* @return BugReport
50+
*/
51+
public function setReportType(string $report_type)
52+
{
53+
$this->report_type = $report_type;
54+
return $this;
55+
}
56+
57+
58+
/**
59+
* @return mixed
60+
*/
61+
public function getEmail()
62+
{
63+
return $this->email;
64+
}
65+
66+
67+
/**
68+
* @param mixed $email
69+
* @return BugReport
70+
*/
71+
public function setEmail($email)
72+
{
73+
$this->email = $email;
74+
return $this;
75+
}
76+
77+
78+
/**
79+
* @return mixed
80+
*/
81+
public function getLink()
82+
{
83+
return $this->link;
84+
}
85+
86+
87+
/**
88+
* @param mixed $link
89+
* @return BugReport
90+
*/
91+
public function setLink(string $link)
92+
{
93+
$this->link = $link;
94+
return $this;
95+
}
96+
97+
98+
/**
99+
* @return mixed
100+
*/
101+
public function getMessage(): string
102+
{
103+
return $this->message;
104+
}
105+
106+
107+
/**
108+
* @param mixed $message
109+
* @return BugReport
110+
*/
111+
public function setMessage(string $message)
112+
{
113+
$this->message = $message;
114+
return $this;
115+
}
116+
}

‎src/Entity/Entity.php‎

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
2+
3+
namespace App\Entity;
4+
5+
6+
abstract class Entity
7+
{
8+
abstract public function getId(): int;
9+
10+
abstract public function toArray(): array;
11+
}

0 commit comments

Comments
(0)

AltStyle によって変換されたページ (->オリジナル) /