This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class DbTask extends Task | |
| { | |
| /** | |
| * @param int $id | |
| * @param string $name | |
| */ | |
| public function __construct($id, $name) | |
| { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| class ProjectMysqlRepository implements ProjectRepository | |
| { | |
| /** | |
| * @param Project $project | |
| * | |
| * @return Project | |
| */ | |
| public function save(Project $project) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $project = new Project('project'); | |
| $project->getTaskCollection()->add('a'); | |
| $project->getTaskCollection()->add('b'); | |
| $project->getTaskCollection()->add('c'); | |
| foreach ($project->getTaskCollection() as $task) { | |
| echo $task->getName(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| $projectRepository = new ProjectRepository; | |
| $project = $projectRepository->save($project); |
OlderNewer