slug = $slug; $this->title = $title; $this->status = $status; $this->issues = $issues; } /** * Gets the entry slug. * * @return string */ public function get_slug() { return $this->slug; } /** * Gets the entry title. * * @return string */ public function get_title() { return $this->title; } /** * Gets the entry status. * * @return string */ public function get_status() { return $this->status; } /** * Gets the entry issues. * * @return Issue[] */ public function get_issues() { return $this->issues; } /** * Counts the total number of issues found in the entry. * * @param string $status Only count issues with the given status. * * @return int */ public function count( $status = '' ) { $i = 0; foreach ( $this->get_issues() as $issue ) { if ( ! $status || $status === $issue->get_status() ) { $i ++; } } return $i; } }