public static function castFrom(Model\Issue $issue) { $cast = new static($issue->project, $issue->id, $issue->getClient()); foreach (static::$properties as $property) { $cast->{$property} = $issue->{$property}; } return $cast; }
/** * @param int $id * @return Issue */ public function openIssue($id) { $issue = new Issue($this, $id, $this->getClient()); return $issue->open(); }
/** * @return Issue[] */ public function issues() { $data = $this->api('milestones')->issues($this->project->id, $this->id); $issues = array(); foreach ($data as $issue) { $issues[] = Issue::fromArray($this->getClient(), $this->project, $issue); } return $issues; }