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:
parent
1f6a81aefb
commit
64a8006973
|
@ -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
|
||||
*
|
||||
|
|
Loading…
Reference in New Issue