ENHANCEMENT Allowing $filter argument in MultiForm->getSavedSteps()

This commit is contained in:
Ingo Schommer 2011-07-19 12:52:21 +02:00
parent 32d56ade02
commit 60c69adf7e

View File

@ -282,15 +282,13 @@ abstract class MultiForm extends Form {
* If you want a full chain of steps regardless if they've already been saved * If you want a full chain of steps regardless if they've already been saved
* to the database, use {@link getAllStepsLinear()}. * to the database, use {@link getAllStepsLinear()}.
* *
* @param String $filter SQL WHERE statement
* @return DataObjectSet|boolean A set of MultiFormStep subclasses * @return DataObjectSet|boolean A set of MultiFormStep subclasses
*/ */
function getSavedSteps() { function getSavedSteps($filter = null) {
return DataObject::get( $filter .= ($filter) ? ' AND ' : '';
'MultiFormStep', $filter .= sprintf("\"SessionID\" = '%s'", $this->session->ID);
sprintf("\"SessionID\" = '%s'", return DataObject::get('MultiFormStep', $filter);
$this->session->ID
)
);
} }
/** /**