Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
decision_tree_question.inc
1 <?php
18 require_once SQ_INCLUDE_PATH.'/asset.inc';
19 
30 {
31 
32 
38  function Decision_Tree_Question($assetid=0)
39  {
40  $this->_ser_attrs = TRUE;
41  $this->Asset($assetid);
42 
43  }//end constructor
44 
45 
53  public function _getAllowedLinks()
54  {
55  $allowed = parent::_getAllowedLinks();
56  $allowed[SQ_LINK_TYPE_2]['decision_tree_question'] = Array('card' => 'M', 'exclusive' => FALSE);
57 
58  return $allowed;
59 
60  }//end _getAllowedLinks()
61 
62 
72  public function _getName($short_name=FALSE)
73  {
74  return ($this->attr('name'));
75 
76  }//end _getName()
77 
78 
99  public function prepareLink(Asset $asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
100  {
101  if ($side_of_link == 'minor' && $dependant != '1' && ($link_type & SQ_SC_LINK_SIGNIFICANT) && ($asset instanceof Page_Decision_Tree || $asset instanceof Decision_Tree_Question)){
102  $dependant = '1';
103  return TRUE;
104  }
105 
106  return FALSE;
107 
108  }//end prepareLink()
109 
110 
111 }//end class
112 
113 ?>