Add Wizard::isComplete()

Wizard::isFinished() is not applicable in case a wizard is a child of another
wizard. Wizard::isComplete() fulfills the need to check whether a user went
through a wizard entirely.

refs #8191
This commit is contained in:
Johannes Meyer 2015-01-21 13:56:53 +01:00
parent 1f6a81aefb
commit 64a8006973
1 changed files with 13 additions and 0 deletions

View File

@ -487,6 +487,19 @@ class Wizard
return $page->getName() === end($pages)->getName();
}
/**
* Return whether all of this wizard's pages were visited by the user
*
* The base implementation just verifies that the very last page has page data available.
*
* @return bool
*/
public function isComplete()
{
$pages = $this->getPages();
return $this->hasPageData($pages[count($pages) - 1]->getName());
}
/**
* Set whether this wizard has been completed
*