Docs, bug fixes in code

This commit is contained in:
Sean Harvey 2008-04-20 00:28:49 +00:00
parent eb5b57f418
commit facf2e3833

View File

@ -32,8 +32,8 @@ class MultiFormStep extends DataObject {
protected static $next_steps; protected static $next_steps;
/** /**
* Each {@link MultiForm} subclass * Each {@link MultiForm} subclass needs at least
* needs at least one step which is marked as the "final" one * one step which is marked as the "final" one
* and triggers the {@link MultiForm->finish()} * and triggers the {@link MultiForm->finish()}
* method that wraps up the whole submission. * method that wraps up the whole submission.
* *
@ -50,9 +50,11 @@ class MultiFormStep extends DataObject {
protected $title; protected $title;
/** /**
* Formfields to be rendered with this step * Form fields to be rendered with this step.
* (Form object is created in {@link MultiForm}. * (Form object is created in {@link MultiForm}.
* This function needs to be implemented *
* This function needs to be implemented on your
* subclasses of MultiFormStep
* *
* @return FieldSet * @return FieldSet
*/ */
@ -61,6 +63,11 @@ class MultiFormStep extends DataObject {
} }
/** /**
* Additional form actions to be rendered with this step.
* (Form object is created in {@link MultiForm}.
*
* Note: This is optional, and is to be implemented
* on your subclasses of MultiFormStep
* *
* @return FieldSet * @return FieldSet
*/ */
@ -74,11 +81,13 @@ class MultiFormStep extends DataObject {
* @return Validator * @return Validator
*/ */
public function getValidator() { public function getValidator() {
return null; return false;
} }
/** /**
* Accessor method for $this->title * Accessor method for $this->title
*
* @return string Title of this step
*/ */
public function getTitle() { public function getTitle() {
return $this->title; return $this->title;
@ -109,8 +118,6 @@ class MultiFormStep extends DataObject {
/** /**
* Save the data for this step into session, serializing it first. * Save the data for this step into session, serializing it first.
* *
* @TODO write a code snippet on how to overload this method!
*
* @param array $data The processed data from save() on MultiForm * @param array $data The processed data from save() on MultiForm
*/ */
public function saveData($data) { public function saveData($data) {
@ -153,11 +160,11 @@ class MultiFormStep extends DataObject {
public function getNextStepFromDatabase() { public function getNextStepFromDatabase() {
$nextSteps = $this->stat('next_steps'); $nextSteps = $this->stat('next_steps');
if(is_string($nextSteps)) { if(is_string($nextSteps)) {
$step = DataObject::get($nextSteps, "SessionID = {$this->SessionID}", 'LastEdited DESC'); $step = DataObject::get_one($nextSteps, "SessionID = {$this->SessionID}");
if($step) return $step->First(); if($step) return $step;
} elseif(is_array($nextSteps)) { } elseif(is_array($nextSteps)) {
$step = DataObject::get($nextSteps[0], "SessionID = {$this->SessionID}", 'LastEdited DESC'); $step = DataObject::get_one($nextSteps[0], "SessionID = {$this->SessionID}");
if($step) return $step->First(); if($step) return $step;
} else { } else {
return false; return false;
} }