modsnippet.map.inc.php 3.3 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172
  1. <?php
  2. /**
  3. * @package modx
  4. * @subpackage mysql
  5. */
  6. $xpdo_meta_map['modSnippet']= array (
  7. 'package' => 'modx',
  8. 'version' => '1.1',
  9. 'table' => 'site_snippets',
  10. 'extends' => 'modScript',
  11. 'tableMeta' =>
  12. array (
  13. 'engine' => 'InnoDB',
  14. ),
  15. 'fields' =>
  16. array (
  17. 'cache_type' => 0,
  18. 'snippet' => NULL,
  19. 'locked' => 0,
  20. 'properties' => NULL,
  21. 'moduleguid' => '',
  22. 'static' => 0,
  23. 'static_file' => '',
  24. ),
  25. 'fieldMeta' =>
  26. array (
  27. 'cache_type' =>
  28. array (
  29. 'dbtype' => 'tinyint',
  30. 'precision' => '1',
  31. 'phptype' => 'integer',
  32. 'null' => false,
  33. 'default' => 0,
  34. ),
  35. 'snippet' =>
  36. array (
  37. 'dbtype' => 'mediumtext',
  38. 'phptype' => 'string',
  39. ),
  40. 'locked' =>
  41. array (
  42. 'dbtype' => 'tinyint',
  43. 'precision' => '1',
  44. 'attributes' => 'unsigned',
  45. 'phptype' => 'boolean',
  46. 'null' => false,
  47. 'default' => 0,
  48. 'index' => 'index',
  49. ),
  50. 'properties' =>
  51. array (
  52. 'dbtype' => 'text',
  53. 'phptype' => 'array',
  54. 'null' => true,
  55. ),
  56. 'moduleguid' =>
  57. array (
  58. 'dbtype' => 'varchar',
  59. 'precision' => '32',
  60. 'phptype' => 'string',
  61. 'null' => false,
  62. 'default' => '',
  63. 'index' => 'fk',
  64. ),
  65. 'static' =>
  66. array (
  67. 'dbtype' => 'tinyint',
  68. 'precision' => '1',
  69. 'attributes' => 'unsigned',
  70. 'phptype' => 'boolean',
  71. 'null' => false,
  72. 'default' => 0,
  73. 'index' => 'index',
  74. ),
  75. 'static_file' =>
  76. array (
  77. 'dbtype' => 'varchar',
  78. 'precision' => '191',
  79. 'phptype' => 'string',
  80. 'null' => false,
  81. 'default' => '',
  82. ),
  83. ),
  84. 'fieldAliases' =>
  85. array (
  86. 'content' => 'snippet',
  87. ),
  88. 'indexes' =>
  89. array (
  90. 'locked' =>
  91. array (
  92. 'alias' => 'locked',
  93. 'primary' => false,
  94. 'unique' => false,
  95. 'type' => 'BTREE',
  96. 'columns' =>
  97. array (
  98. 'locked' =>
  99. array (
  100. 'length' => '',
  101. 'collation' => 'A',
  102. 'null' => false,
  103. ),
  104. ),
  105. ),
  106. 'moduleguid' =>
  107. array (
  108. 'alias' => 'moduleguid',
  109. 'primary' => false,
  110. 'unique' => false,
  111. 'type' => 'BTREE',
  112. 'columns' =>
  113. array (
  114. 'moduleguid' =>
  115. array (
  116. 'length' => '',
  117. 'collation' => 'A',
  118. 'null' => false,
  119. ),
  120. ),
  121. ),
  122. 'static' =>
  123. array (
  124. 'alias' => 'static',
  125. 'primary' => false,
  126. 'unique' => false,
  127. 'type' => 'BTREE',
  128. 'columns' =>
  129. array (
  130. 'static' =>
  131. array (
  132. 'length' => '',
  133. 'collation' => 'A',
  134. 'null' => false,
  135. ),
  136. ),
  137. ),
  138. ),
  139. 'composites' =>
  140. array (
  141. 'PropertySets' =>
  142. array (
  143. 'class' => 'modElementPropertySet',
  144. 'local' => 'id',
  145. 'foreign' => 'element',
  146. 'owner' => 'local',
  147. 'cardinality' => 'many',
  148. 'criteria' =>
  149. array (
  150. 'foreign' =>
  151. array (
  152. 'element_class' => 'modSnippet',
  153. ),
  154. ),
  155. ),
  156. ),
  157. 'validation' =>
  158. array (
  159. 'rules' =>
  160. array (
  161. 'name' =>
  162. array (
  163. 'invalid' =>
  164. array (
  165. 'type' => 'preg_match',
  166. 'rule' => '/^(?!\\s)[a-zA-Z0-9\\x2d-\\x2f\\x7f-\\xff-_\\s]+(?!\\s)$/',
  167. 'message' => 'snippet_err_invalid_name',
  168. ),
  169. ),
  170. ),
  171. ),
  172. );