DNADesign\SilverStripeElementalDecisionTree\Model\DecisionTreeStep
Synopsis
class DecisionTreeStep
extends DataObject
{
- // members
- private static array $db = ;
- private static array $has_many = ;
- private static array $owns = ;
- private static array $cascade_deletes = ;
- private static string $table_name = 'DecisionTreeStep';
- private static array $belongs_to = ;
- private static array $summary_fields = ;
- private static string $default_result_title = 'Our recommendation';
- // methods
- public void getCMSFields()
- public void onBeforeWrite()
- public void canCreate()
- public void canView()
- public void canEdit()
- public void canDelete()
- public HTMLText getAnswerTreeForGrid()
- public OptionsetField getAnswersOptionset()
- public DecisionTreeAnswer getParentAnswer()
- public Array getAnswerPathway()
- public Array getQuestionPathway()
- public Array getFullPathway()
- public DecisionTreeStep getTreeOrigin()
- public Int getPositionInPathway()
- public static SS_List get_orphans()
- public static SS_List get_initial_steps()
- public void belongsToTree()
- public void belongsToElement()
- public void belongsToAnswer()
- public Boolean IsCurrentlyEdited()
- public String CMSEditLink()
- public String getRecursiveEditPath()
Hierarchy
Extends
- SilverStripe\ORM\DataObject
Members
private
- $belongs_to
- $cascade_deletes
- $db
- $default_result_title
- $has_many
- $owns
- $summary_fields
- $table_name
Methods
public
- CMSEditLink() — Create a link that allowd to edit this object in the CMS To do this, it rewinds the tree up to the element then append its edit url to the edit url of its parent question
- IsCurrentlyEdited() — Checks if this object is currently being edited in the CMS by comparing its ID with the one in the request
- belongsToAnswer()
- belongsToElement()
- belongsToTree()
- canCreate()
- canDelete()
- canEdit()
- canView()
- getAnswerPathway() — Return the list of DecisionTreeAnswer ID leading to this step being displayed
- getAnswerTreeForGrid() — Return a readable list of the answer title and the title of the question which will be displayed if the answer is selected Used for Gridfield
- getAnswersOptionset() — Outputs an optionset to allow user to select an answer to the question
- getCMSFields()
- getFullPathway() — Builds an array of question and answers leading to this Step Each entry is an array which key is either 'question' or 'answer' and value is the ID of the object Note: the array is in reverse order
- getParentAnswer() — Return the DecisionAnswer rsponsible for displaying this step
- getPositionInPathway() — Return this step position in the pathway Used to number step on the front end
- getQuestionPathway() — Return the list of DecisionTreeStep ID leading to this step being displayed
- getRecursiveEditPath() — Build url to allow to edit this object
- getTreeOrigin() — Find the very first DecisionStep in the tree
- get_initial_steps() — Return a DataList of all DecisionTreeStep that do not belong to an answer ie. are the first child of a element
- get_orphans() — Return a DataList of DecisionTreeStep that do not belong to a Tree
- onBeforeWrite() — Set default title on Result steps