Skip to content

Instantly share code, notes, and snippets.

@adammbalogh
Last active October 12, 2016 07:34
Show Gist options
  • Save adammbalogh/4ffe2037d567e43af636ef56318e6a9f to your computer and use it in GitHub Desktop.
Save adammbalogh/4ffe2037d567e43af636ef56318e6a9f to your computer and use it in GitHub Desktop.
<?php
class Project
{
/** @var null|int */
protected $id;
/** @var string */
protected $name;
/** @var TaskCollection */
protected $taskCollection;
public function __construct($name)
{
$this->name = $name;
$this->taskCollection = new TaskCollection([]);
}
public function getId()
{
return $this->id;
}
public function getName()
{
return $this->name;
}
public function getTaskCollection()
{
if (is_null($this->taskCollection)) {
throw new TasksAreNotAccessibleException;
}
return $this->taskCollection;
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment