mirror of
https://github.com/silverstripe/silverstripe-userforms.git
synced 2024-10-22 17:05:42 +02:00
49 lines
876 B
PHP
49 lines
876 B
PHP
<?php
|
|
|
|
/**
|
|
* Represents a page step in a form, which may contain form fields or other groups
|
|
*/
|
|
class UserFormsStepField extends UserFormsCompositeField
|
|
{
|
|
|
|
private static $casting = array(
|
|
'StepNumber' => 'Int'
|
|
);
|
|
|
|
/**
|
|
* Numeric index (1 based) of this step
|
|
*
|
|
* Null if unassigned
|
|
*
|
|
* @var int|null
|
|
*/
|
|
protected $number = null;
|
|
|
|
public function FieldHolder($properties = array())
|
|
{
|
|
return $this->Field($properties);
|
|
}
|
|
|
|
/**
|
|
* Get the step number
|
|
*
|
|
* @return int|null
|
|
*/
|
|
public function getStepNumber()
|
|
{
|
|
return $this->number;
|
|
}
|
|
|
|
/**
|
|
* Re-assign this step to another number
|
|
*
|
|
* @param type $number
|
|
* @return $this
|
|
*/
|
|
public function setStepNumber($number)
|
|
{
|
|
$this->number = $number;
|
|
return $this;
|
|
}
|
|
}
|