18 require_once SQ_CORE_PACKAGE_PATH.
'/folder/folder.inc';
43 parent::__construct($assetid);
61 require_once SQ_CORE_PACKAGE_PATH.
'/system/system_asset_fns.inc';
62 if (!system_asset_fns_create_pre_check($this)) {
65 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
66 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
68 if ($linkid = parent::create($link)) {
69 if (!system_asset_fns_create_cleanup($this)) {
75 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
77 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'ROLLBACK');
80 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();
109 public function morph($new_type_code)
111 trigger_localised_error(
'CORE0091', E_USER_WARNING, $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($this->type(),
'name'));
128 if ($name ==
'name') {
129 trigger_localised_error(
'CORE0111', E_USER_WARNING, $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($this->type(),
'name'));
133 return parent::setAttrValue($name, $value);
154 public function createLink(
Asset $minor, $link_type, $value=
'', $sort_order=NULL, $dependant=
'0', $exclusive=
'0')
156 if ($GLOBALS[
'SQ_SYSTEM']->runLevelEnables(SQ_SECURITY_LINK_INTEGRITY)) {
157 trigger_localised_error(
'CORE0117', E_USER_WARNING, $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($this->type(),
'name'));
161 return parent::createLink($minor, $link_type, $value, $sort_order, $dependant, $exclusive);
177 trigger_localised_error(
'CORE0118', E_USER_WARNING, $GLOBALS[
'SQ_SYSTEM']->am->getTypeInfo($this->type(),
'name'));
205 return Array(SQ_LINK_TYPE_1 => Array(
'design' => Array(
'card' =>
'M',
'exclusive' => TRUE)));
222 public function writeAccess($lock_type=
'', Array $assetids=Array())
226 if (empty($assetids)) {
227 if ($GLOBALS[
'SQ_SYSTEM']->userRoot()) {
228 return parent::writeAccess($lock_type, $assetids);
231 $root_user = $GLOBALS[
'SQ_SYSTEM']->am->getSystemAsset(
'root_user');
232 if (in_array($root_user->id, $assetids)) {
233 return parent::writeAccess($lock_type, $assetids);