17 require_once SQ_CORE_PACKAGE_PATH.
'/folder/folder.inc';
42 parent::__construct($assetid);
55 $lock_types = parent::lockTypes();
56 $lock_types[
'content'] = ($lock_types[
'attributes'] | $lock_types[
'links']);
72 SQ_LINK_TYPE_1 => Array(),
73 SQ_LINK_TYPE_2 => Array(
'metadata_section' => Array(
'card' =>
'M',
'exclusive' => FALSE)),
74 SQ_LINK_TYPE_3 => Array(),
75 SQ_LINK_NOTICE => Array(),
101 public function prepareLink(
Asset $asset, $side_of_link, &$link_type, &$value, &$sort_order, &$dependant, &$exclusive)
104 if ($side_of_link ==
'major' && ($asset instanceof
Metadata_Section) && $dependant !=
'1') {
105 $link_type = SQ_LINK_TYPE_2;
125 public function delete($release_lock=TRUE)
127 if (parent::delete($release_lock)) {
128 $GLOBALS[
'SQ_SYSTEM']->changeDatabaseConnection(
'db2');
130 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'BEGIN');
134 $sql =
'DELETE FROM sq_ast_mdata WHERE ';
135 $sql .=
'schemaid = :schemaid';
141 }
catch (Exception $e) {
142 throw new Exception(
'Unable to delete metadata schema with schemaid #'.$this->
id.
' due to the following database error:'.$e->getMessage());
145 $GLOBALS[
'SQ_SYSTEM']->doTransaction(
'COMMIT');
146 $GLOBALS[
'SQ_SYSTEM']->restoreDatabaseConnection();