Skip to content

Commit 86a2171

Browse files
committed
Added DataMapper UML
1 parent 287e242 commit 86a2171

File tree

4 files changed

+31
-0
lines changed

4 files changed

+31
-0
lines changed

Structural/DataMapper/README.md

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,3 +16,7 @@ The key point of this pattern is, unlike Active Record pattern, the data model f
1616
## Examples
1717

1818
* DB Object Relational Mapper (ORM) : Doctrine2 uses DAO named as "EntityRepository"
19+
20+
## UML Diagram
21+
22+
![Alt DataMapper UML Diagram](uml/uml.png)

Structural/DataMapper/uml/uml.png

4.76 KB
Loading

Structural/DataMapper/uml/uml.svg

Lines changed: 1 addition & 0 deletions
Loading

Structural/DataMapper/uml/uml.txt

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
@startuml
2+
class User {
3+
protected $userId
4+
protected $username
5+
protected $email
6+
+__construct($id = null, $username = null, $email = null)
7+
+getUserId()
8+
+setUserID($userId)
9+
+getUsername()
10+
+setUsername($username)
11+
+getEmail()
12+
+setEmail($email)
13+
}
14+
15+
class UserMapper {
16+
protected $adapter
17+
+__construct(DBAL $dbLayer)
18+
+save(User $user)
19+
+findById($id)
20+
+findAll()
21+
+mapObject(array $row)
22+
}
23+
24+
User
25+
UserMapper
26+
@enduml

0 commit comments

Comments
 (0)