silverstripe-userforms/code/FormField/UserFormsStepField.php

50 lines
910 B
PHP
Raw Permalink Normal View History

<?php
namespace SilverStripe\UserForms\FormField;
/**
* Represents a page step in a form, which may contain form fields or other groups
*/
2016-07-21 07:53:59 +02:00
class UserFormsStepField extends UserFormsCompositeField
{
private static $casting = [
2016-07-21 07:53:59 +02:00
'StepNumber' => 'Int'
];
2016-07-21 07:53:59 +02:00
/**
* Numeric index (1 based) of this step
*
* Null if unassigned
*
* @var int|null
*/
protected $number = null;
public function FieldHolder($properties = [])
2016-07-21 07:53:59 +02:00
{
return $this->Field($properties);
}
2016-07-21 07:53:59 +02:00
/**
* Get the step number
*
* @return int|null
*/
public function getStepNumber()
{
return $this->number;
}
2016-07-21 07:53:59 +02:00
/**
* Re-assign this step to another number
*
* @param type $number
* @return $this
*/
public function setStepNumber($number)
{
$this->number = $number;
return $this;
}
}