Can i draw a UML class diagram that some how explain that my function do not return value, but rather echo it?
Here is an pseudoísh example of what my class looks like:
class api {
private $data;
public function dosomething() {
$data = $this->getDataFromDatabase();
echo json_encode($data);
}
private function getDataFromDatabase() {
....
}
}
Here is a class diagram that shows my class above.
-----------------------------------
api
-----------------------------------
- data : string
-----------------------------------
+ dosomething() : void
- getDataFromDatabase() : array
-----------------------------------
You can either use : void
or leave it away to show that it does not return anything. So the above is ok and alternatively you could write
-----------------------------------
api
-----------------------------------
- data : string
-----------------------------------
+ dosomething()
- getDataFromDatabase() : array
-----------------------------------