Guest User

Untitled

a guest
Nov 21st, 2013
20
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?xml version="1.0" encoding="utf-8" standalone="no" ?>
  2. <ormd2-configuration xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance">
  3.  
  4. <!-- ===================================== -->
  5. <!-- ========== ORM ====== -->
  6. <!-- ===================================== -->
  7. <orm-configuration name="Propel" caption="Propel ORM" image="logoPropel.png" >
  8.  
  9. <!-- ======== SCRIPTS ============= -->
  10. <script-settings>
  11. <script-file name="../Utils/FileTools.osc"/>
  12. <script-file name="Propel.import.osc"/>
  13. <script-file name="Propel.export.osc"/>
  14. <function type="import-function" name="PropelImport"/>
  15. <function type="export-function" name="PropelExport"/>
  16. <function type="file-scanner-function" name="PropelDirectoryScanner"/>
  17. <function type="get-module-info-function" name="PropelGetModuleInfoFromFile"/>
  18. </script-settings>
  19.  
  20. <!-- ======== IMPORT EXPORT FORMATS ============= -->
  21. <import-export-formats>
  22. <import-export-format name="PropelYml" type="file" caption="Propel Yml"/>
  23. <import-export-format name="PropelXml" type="file" caption="Propel Xml"/>
  24. </import-export-formats>
  25.  
  26. <!-- ======== ATTRIBUTES ============= -->
  27. <attribute-types>
  28.  
  29. <struct name="Module">
  30. <attribute name="name" type="string" help-text="name which is exported to database element"/>
  31. <attribute name="defaultIdMethod" type="enum" enum-values="native|none" help-text="default=`none`"/>
  32. <attribute name="package" type="string" help-text="default=`project name`"/>
  33. <attribute name="schema" type="string" help-text="pecifies the default SQL schema containing the tables. Ignored on RDBMS not supporting database schemas"/>
  34. <attribute name="namespace" type="string" help-text="Namespace for all entities in this module"/>
  35. <attribute name="baseClass" type="string" help-text="default=`propel.om.BaseObject`"/>
  36. <attribute name="basePeer" type="string" help-text="default=`propel.util.BasePeer`"/>
  37. <attribute name="defaultPhpNamingMethod" type="enum" help-text="default=`underscore`" enum-values="nochange|underscore|phpname"/>
  38. <attribute name="heavyIndexing" type="bool" help-text="default=`false`"/>
  39. <attribute name="tablePrefix" type="string" help-text="adds a prefix to all the SQL table names."/>
  40. <ordered name="behaviors" type="/Behaviors"/>
  41. </struct>
  42.  
  43. <struct name="Entity">
  44. <attribute name="idMethod" type="enum" enum-values="native|none" help-text="Sets the id method to use for auto-increment columns. default=`none`"/>
  45. <attribute name="phpName" type="string" help-text="Specifies object model class name. By default, Propel uses a CamelCase version of the table name as phpName"/>
  46. <attribute name="package" type="string" help-text="specifies the `package` (or subdirectory) in which model classes get generated"/>
  47. <attribute name="schema" type="string" help-text="specifies the default SQL schema containing the table. Ignored on RDBMS not supporting database schemas"/>
  48. <attribute name="namespace" type="string" help-text="Namespace for this entity. Use \name to define absolute namespace (starting with a backslash)."/>
  49. <attribute name="skipSql" type="bool" help-text="instructs Propel not to generate DDL SQL for the specified table. This can be used together with readOnly for supporting VIEWS in Propel.default=`false`"/>
  50. <attribute name="abstract" type="bool" help-text="Whether the generated stub class will be abstract (e.g. if you're using inheritance). default=`false`"/>
  51. <attribute name="phpNamingMethod" type="enum" help-text="the naming method to use. Defaults to underscore, which transforms the table name into a CamelCase phpName. default=`underscore`" enum-values="nochange|underscore|phpname|clean"/>
  52. <attribute name="baseClass" type="string" help-text="allows you to specify a class that the generated Propel objects should extend (in place of propel.om.BaseObject)."/>
  53. <attribute name="basePeer" type="string" help-text="instructs Propel to use a different SQL-generating BasePeer class (or sub-class of BasePeer)." />
  54. <attribute name="heavyIndexing" type="bool" help-text="adds indexes for each component of the primary key (when using composite primary keys)."/>
  55. <attribute name="readOnly" type="bool" help-text="suppresses the mutator/setter methods, save() and delete() methods."/>
  56. <attribute name="treeMode" type="enum" enum-values="NestedSet|MaterializedPath" help-text="is used to indicate that this table is part of a node tree." />
  57. <attribute name="reloadOnInsert" type="bool" help-text="is used to indicate that the object should be reloaded from the database when an INSERT is performed. This is useful if you have triggers (or other server-side functionality like column default expressions) that alters the database row on INSERT."/>
  58. <attribute name="reloadOnUpdate" type="bool" help-text="is used to indicate that the object should be reloaded from the database when an UPDATE is performed. This is useful if you have triggers (or other server-side functionality like column default expressions) that alters the database row on UPDATE."/>
  59. <attribute name="allowPkInsert" type="bool" help-text="can be used if you want to define the primary key of a new object being inserted. By default if idMethod is `native`, Propel would throw an exception. However, in some cases this feature is useful, for example if you do some replication of data in an master-master environment. It defaults to false."/>
  60. <attribute name="isI18N" type="bool"/>
  61. <attribute name="i18nTable" type="entity"/>
  62. <ordered name="behaviors" type="/Behaviors"/>
  63. <ordered name="vendors">
  64. <struct name="vendor">
  65. <attribute name="type" type="string" help-text="Vendor type"/>
  66. <ordered name="parameters">
  67. <struct name="parameter">
  68. <attribute name="name" type="string" help-text="Vendor type"/>
  69. <attribute name="value" type="string" help-text="Vendor type"/>
  70. </struct>
  71. </ordered>
  72. </struct>
  73. </ordered>
  74. </struct>
  75.  
  76. <struct name="Field">
  77. <attribute name="phpName" type="string"/>
  78. <attribute name="peerName" type="string"/>
  79. <attribute name="phpType" type="string"/>
  80. <attribute name="sqlType" type="string"/>
  81. <attribute name="scale" type="string"/>
  82. <attribute name="defaultValue" type="string" help-text="The default value that the object will have for this column in the PHP instance after creating a `new Object`. This value is always interpreted as a string."/>
  83. <attribute name="defaultExpr" type="string" help-text="The default value for this column as expressed in SQL. This value is used solely for the `sql` target which builds your database from the schema.xml file. The defaultExpr is the SQL expression used as the `default` for the column."/>
  84. <attribute name="valueSet" type="string"/>
  85. <attribute name="lazyLoad" type="string"/>
  86. <attribute name="description" type="string"/>
  87. <attribute name="primaryString" type="bool" help-text="A column defined as primary string serves as default value for a __toString() method in the generated Propel object."/>
  88.  
  89. <attribute name="isCulture" type="string"/>
  90. <attribute name="index" type="string"/>
  91. <attribute name="onDelete" type="string"/>
  92. <attribute name="phpNamingMethod" type="enum" enum-values="nochange|underscore|phpname"/>
  93. <attribute name="inheritance" type="enum" help-text="default=`false`" enum-values="single|false"/>
  94. <attribute name="inputValidator" type="string"/>
  95. <ordered name="validators" type="/Validators" />
  96. </struct>
  97.  
  98. <struct name="Index-field">
  99. <attribute name="size" type="integer"/>
  100. </struct>
  101.  
  102. <struct name="Association">
  103. <attribute name="onDelete" type="enum" enum-values="cascade"/>
  104. <attribute name="onUpdate" type="enum" enum-values="cascade"/>
  105. <attribute name="phpName" type="string"/>
  106. <attribute name="refPhpName" type="string" />
  107. <attribute name="skipSql" type="bool" help-text="Instructs Propel not to generate DDL SQL for the specified foreign key. This can be used to support relationships in the model without an actual foreign key."/>
  108. <attribute name="defaultJoin" type="enum" enum-values="Criteria::INNER_JOIN|Criteria::LEFT_JOIN" help-text="This affects the default join type used in the generated joinXXX() methods in the model query class."/>
  109. </struct>
  110.  
  111. <struct name="ManyToManyEntity">
  112. <attribute name="onDelete" type="enum" enum-values="cascade"/>
  113. <attribute name="onUpdate" type="enum" enum-values="cascade"/>
  114. <attribute name="phpName" type="string"/>
  115. <attribute name="refPhpName" type="string" />
  116. <attribute name="skipSql" type="bool" help-text="Instructs Propel not to generate DDL SQL for the specified foreign key. This can be used to support relationships in the model without an actual foreign key."/>
  117. <attribute name="defaultJoin" type="enum" enum-values="Criteria::INNER_JOIN|Criteria::LEFT_JOIN" help-text="This affects the default join type used in the generated joinXXX() methods in the model query class."/>
  118. </struct>
  119.  
  120. <!-- ================ BEHAVIOURS ================= -->
  121. <struct name="BehaviorBase">
  122. <ordered name="customParameters" type="/CustomParameter" help-text="List of additional parameters for specific behavior"/>
  123. </struct>
  124.  
  125. <struct name="CustomParameter">
  126. <attribute name="name" type="string" help-text="custom parameter name"/>
  127. <attribute name="value" type="string" help-text="custom parameter value"/>
  128. </struct>
  129.  
  130. <group name="Behaviors">
  131. <struct name="customBehavior" inherit="../../struct[@name='BehaviorBase']" help-text="Use custom behavior to define any specific behavior not listed in behavior list.">
  132. <attribute name="name" type="string" help-text="custom behavior name"/>
  133. </struct>
  134. <struct name="nested_set" inherit="../../struct[@name='BehaviorBase']" help-text="The nested_set behavior allows a model to become a tree structure, and provides numerous methods to traverse the tree in an efficient way.">
  135. <attribute name="left_column" type="field" />
  136. <attribute name="right_column" type="field" />
  137. <attribute name="level_column" type="field" />
  138. <attribute name="use_scope" type="bool" />
  139. <attribute name="scope_column" type="field" />
  140. </struct>
  141. <struct name="soft_delete" inherit="../../struct[@name='BehaviorBase']" help-text="The soft_delete behavior overrides the deletion methods of a model object to make them 'hide' the deleted rows but keep them in the database. Deleted objects still don't show up on select queries, but they can be retrieved or undeleted when necessary.">
  142. <attribute name="deleted_column" type="field" />
  143. </struct>
  144. <struct name="sluggable" inherit="../../struct[@name='BehaviorBase']" help-text="The sluggable behavior allows a model to offer a human readable identifier that can be used for search engine friendly URLs.">
  145. <attribute name="slug_column" type="field" />
  146. <attribute name="slug_pattern" type="string" />
  147. <attribute name="replace_pattern" type="string" />
  148. <attribute name="replacement" type="string" />
  149. <attribute name="separator" type="string" />
  150. <attribute name="permanent" type="bool" />
  151. </struct>
  152. <struct name="sortable" inherit="../../struct[@name='BehaviorBase']" help-text="The sortable behavior allows a model to become an ordered list, and provides numerous methods to traverse this list in an efficient way.">
  153. <attribute name="rank_column" type="field" />
  154. <attribute name="use_scope" type="bool" />
  155. <attribute name="scope_column" type="field" />
  156. </struct>
  157. <struct name="aggregate_column" inherit="../../struct[@name='BehaviorBase']" help-text="The aggregate_column behavior keeps a column updated using an aggregate function executed on a related table.">
  158. <attribute name="name" type="string" />
  159. <attribute name="foreign_table" type="entity" />
  160. <attribute name="expression" type="string" />
  161. </struct>
  162. <struct name="versionable" inherit="../../struct[@name='BehaviorBase']" help-text="The versionable behavior provides versioning capabilities to any ActiveRecord object.">
  163. <attribute name="version_column" type="field" />
  164. </struct>
  165. <struct name="i18n" inherit="../../struct[@name='BehaviorBase']" help-text="The i18n behavior provides internationalization to any ActiveRecord object. Using this behavior, you can separate text data from the other data, and keep several translations of the text data for a single object. Applications supporting several languages always use the i18n behavior.">
  166. <ordered name="i18n_columns" type="field" />
  167. <attribute name="locale_column" type="field" />
  168. <attribute name="i18n_table" type="entity" />
  169. <attribute name="i18n_phpname" type="string" />
  170. </struct>
  171. <struct name="query_cache" inherit="../../struct[@name='BehaviorBase']" help-text="The query_cache behavior gives a speed boost to Propel queries by caching the transformation of a PHP Query object into reusable SQL code.">
  172. <attribute name="backend" type="field" />
  173. <attribute name="lifetime" type="integer" />
  174. </struct>
  175. <struct name="auto_add_pk" inherit="../../struct[@name='BehaviorBase']" help-text="The auto_add_pk behavior adds a primary key columns to the tables that don't have one. Using this behavior allows you to omit the declaration of primary keys in your tables.">
  176. <attribute name="name" type="string" />
  177. <attribute name="autoIncrement" type="bool" />
  178. <attribute name="type" type="string" />
  179. </struct>
  180. <struct name="alternative_coding_standards" inherit="../../struct[@name='BehaviorBase']" help-text="The alternative_coding_standards behavior changes the coding standards of the model classes generated by Propel to match your own coding style.">
  181. <attribute name="brackets_newline" type="bool" />
  182. <attribute name="remove_closing_comments" type="bool" />
  183. <attribute name="use_whitespace" type="bool" />
  184. <attribute name="tab_size" type="integer" />
  185. <attribute name="strip_comments" type="bool" />
  186. </struct>
  187. <struct name="timestampable" inherit="../../struct[@name='BehaviorBase']">
  188. <attribute name="create_column" type="field" help-text="Column for store created_at"/>
  189. <attribute name="update_column" type="field" help-text="Column for store updated_at"/>
  190. </struct>
  191. </group>
  192.  
  193. <!-- ============================================= -->
  194. <!-- ================ VALIDATORS ================= -->
  195. <!-- ============================================= -->
  196. <struct name="ValidatorBase">
  197. <attribute name="message" type="string" export-tag="base" help-text="The message key allows you to define a custom validation error message for the rule"/>
  198. </struct>
  199.  
  200. <group name="Validators">
  201. <struct name="match" inherit="../../struct[@name='ValidatorBase']" help-text="The MatchValidator is used to run a regular expression of choice against the column. Note that this is a preg, not ereg.">
  202. <attribute name="value" type="string"/>
  203. </struct>
  204. <struct name="notMatch" inherit="../../struct[@name='ValidatorBase']" help-text="Opposite of `MatchValidator`, this validator returns false if the regex returns true.">
  205. <attribute name="value" type="string"/>
  206. </struct>
  207. <struct name="maxLength" inherit="../../struct[@name='ValidatorBase']" help-text="When you want to limit the size of the string to be inserted in a column, use the MaxLengthValidator. Internally, it uses strlen() to get the length of the string. For instance, some database completely ignore the lentgh of LONGVARCHAR columns; you can enforce it using a validator.">
  208. <attribute name="value" type="integer"/>
  209. </struct>
  210. <struct name="minLength" inherit="../../struct[@name='ValidatorBase']" help-text="When you want to limit the size of the string to be inserted in a column, use the MinLengthValidator. Internally, it uses strlen() to get the length of the string. For instance, some database completely ignore the lentgh of LONGVARCHAR columns; you can enforce it using a validator.">
  211. <attribute name="value" type="integer"/>
  212. </struct>
  213. <struct name="maxValue" inherit="../../struct[@name='ValidatorBase']" help-text="To limit the value of an integer column, use the MaxValueValidator. Note that this validator uses a non-strict comparison ('less than or equal')">
  214. <attribute name="value" type="integer"/>
  215. </struct>
  216. <struct name="minValue" inherit="../../struct[@name='ValidatorBase']" help-text="To limit the value of an integer column, use the MaxValueValidator. Note that this validator uses a non-strict comparison ('less than or equal')">
  217. <attribute name="value" type="integer"/>
  218. </struct>
  219. <struct name="required" inherit="../../struct[@name='ValidatorBase']" help-text="This validtor checks the same rule as a required=true on the column at the database level. However it will not give you a clean error to work with."/>
  220. <struct name="unique" inherit="../../struct[@name='ValidatorBase']" help-text="To check whether the value already exists in the table, use the UniqueValidator."/>
  221. <struct name="validValues" inherit="../../struct[@name='ValidatorBase']" help-text="This rule restricts the valid values to a list delimited by a pipe ('|').">
  222. <attribute name="value" type="string"/>
  223. </struct>
  224. <struct name="type" inherit="../../struct[@name='ValidatorBase']" help-text="Restrict values to a certain PHP type using the TypeValidator.">
  225. <attribute name="value" type="string"/>
  226. </struct>
  227. <struct name="otherValidator" inherit="../../struct[@name='ValidatorBase']" help-text="Use this for other propel validator if missing in validator list.">
  228. <attribute name="name" type="string" help-text="Validator name."/>
  229. <attribute name="value" type="string"/>
  230. </struct>
  231. <struct name="customValidator" inherit="../../struct[@name='ValidatorBase']" help-text="Use this for other propel validator if missing in validator list.">
  232. <attribute name="class" type="string" help-text="Validator class."/>
  233. <attribute name="value" type="string"/>
  234. </struct>
  235. </group>
  236. </attribute-types>
  237.  
  238. <!-- ===================================== -->
  239. <!-- ========== ORM INHERITANCE ====== -->
  240. <!-- ===================================== -->
  241. <inheritances-types>
  242. <inheritance-type name="single_table" caption="Single Table Inheritance" />
  243. <inheritance-type name="class_table" caption="Class Table Inheritance" />
  244. <inheritance-type name="concrete_table" caption="Concrete Table Inheritance" />
  245. </inheritances-types>
  246.  
  247. <!-- ===================================== -->
  248. <!-- ========== ORM DATA TYPES ===== -->
  249. <!-- ===================================== -->
  250. <data-types>
  251. <data-type name="Boolean" unified-name="@BOOL"/>
  252. <data-type name="Integer" unified-name="@INTEGER,@INT" primary-key-data-type="true"/>
  253. <data-type name="Float" unified-name="@FLOAT"/>
  254. <data-type name="Double" unified-name="@DOUBLE"/>
  255. <data-type name="Real" unified-name="@REAL"/>
  256. <data-type name="Decimal" unified-name="@DECIMAL" />
  257. <data-type name="TinyInt" unified-name="@TINYINT"/>
  258. <data-type name="BigInt" unified-name="@BIGINT"/>
  259. <data-type name="Char" unified-name="@CHAR,@CHARACTER"/>
  260. <data-type name="Varchar" unified-name="@VARCHAR"/>
  261. <data-type name="LongVarchar" unified-name="@LONGVARCHAR,@TEXT"/>
  262. <data-type name="CLOB" unified-name="@CLOB"/>
  263. <data-type name="BLOB" unified-name="@BLOB"/>
  264. <data-type name="Date" unified-name="@DATE"/>
  265. <data-type name="Time" unified-name="@TIME"/>
  266. <data-type name="Timestamp" unified-name="@TIMESTAMP,@DATETIME"/>
  267. <data-type name="ENUM" unified-name="@ENUM" has-enum-values="true"/>
  268. <data-type name="Array" unified-name="@ARRAY"/>
  269. </data-types>
  270.  
  271. <!-- ======================================== -->
  272. <!-- ========== ELEMENT TEMPLATES ===== -->
  273. <!-- ======================================== -->
  274. <element-templates>
  275. <template name='new-project'>
  276. <project>
  277. <module name="MainModule" size-x="11" size-y="22" size-x2="33" size-y2="44">
  278. <entity name="SampleEntity" position-x="10" position-y="20">
  279. <field name="id" type="integer" required="true" unique="true" primary="true" auto-increment="true"/>
  280. <field name="name" type="varchar" size="255"/>
  281. </entity>
  282. </module>
  283. </project>
  284. </template>
  285.  
  286. <!-- #CFU - CamelCase-FirstUpper, #CFL - CamelCase-FirstLower, #UL - UnderLine -->
  287. <template name='primary-field'>
  288. <field name="id" type="Integer" required="true" primary="true" auto-increment="true"/>
  289. </template>
  290. <template name='association-field'>
  291. <field name="{inverseEntityName#UL}_{inverseFieldName#UL}"/>
  292. </template>
  293. <template name='many2many-field'>
  294. <field name="{inverseEntityName#UL}_{inverseFieldName#UL}" required="true" primary="true"/>
  295. </template>
  296. <template name='discriminator-field'>
  297. <field required="true" type="string"/>
  298. </template>
  299. </element-templates>
  300.  
  301. </orm-configuration>
  302.  
  303. <!-- ===================================== -->
  304. <!-- ========== ORM & MVC ====== -->
  305. <!-- ===================================== -->
  306. <mvc-support-orm mvc-name="Without MVC" orm-name="Propel" />
  307. <mvc-support-orm mvc-name="Zend Framework" orm-name="Propel"/>
  308.  
  309. <mvc-support-orm mvc-name="Symfony" orm-name="Propel">
  310. <script-settings>
  311. <script-file name="Propel.Symfony.import.osc"/>
  312. <function type="file-scanner-function" name="SymfonyPropelDirectoryScanner"/>
  313. </script-settings>
  314. </mvc-support-orm>
  315.  
  316. <mvc-support-orm mvc-name="Symfony2" orm-name="Propel">
  317. <script-settings>
  318. <script-file name="Propel.Symfony.import.osc"/>
  319. <function type="file-scanner-function" name="SymfonyPropelDirectoryScanner"/>
  320. </script-settings>
  321. </mvc-support-orm>
  322.  
  323. </ormd2-configuration>
RAW Paste Data