modsnippet.map.inc.php 2.9 KB

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