Squiz Matrix  4.12.2
 All Data Structures Namespaces Functions Variables Pages
data_record.inc
1 <?php
18 require_once SQ_INCLUDE_PATH.'/asset.inc';
19 
31 class Data_Record extends Asset
32 {
33 
34 
41  function __construct($assetid=0)
42  {
43  $this->_ser_attrs = TRUE;
44  parent::__construct($assetid);
45 
46  }//end constructor
47 
48 
59  protected function _createAdditional(Array &$link)
60  {
61  if (!parent::_createAdditional($link)) return FALSE;
62 
63  // set an initial web path
64  $initial_path = strtolower($this->attr('name'));
65  require_once SQ_INCLUDE_PATH.'/general_occasional.inc';
66  $valid_paths = make_valid_web_paths(Array($initial_path));
67  $good_paths = $GLOBALS['SQ_SYSTEM']->am->webPathsInUse($link['asset'], $valid_paths, $this->id, TRUE);
68  return $this->saveWebPaths($good_paths);
69 
70  }//end _createAdditional()
71 
72 
82  protected function _getName($short_name=FALSE, $contextid=NULL)
83  {
84  // No context specified, using the current context
85  if ($contextid === NULL) {
86  $contextid = $GLOBALS['SQ_SYSTEM']->getContextId();
87  }//end if
88 
89  // Obtain the attribute value for Name from the specified Context
90  $values = $GLOBALS['SQ_SYSTEM']->am->getAttributeValuesByName('name', $this->type(), Array($this->id), $contextid);
91  if (empty($values) === TRUE) {
92  return parent::_getName($short_name, $contextid);
93  } else {
94  return $values[$this->id];
95  }
96 
97 
98  return $this->attr('name');
99 
100  }//end _getName()
101 
102 
110  public function _getAllowedLinks()
111  {
112  return Array(
113  SQ_LINK_TYPE_1 => Array(
114  'folder' => Array('card' => 'M', 'exclusive' => FALSE),
115  ),
116  );
117 
118  }//end _getAllowedLinks()
119 
120 
121 }//end class
122 
123 ?>