BaseKataoSupplierInvoicePeer.php 52 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407
  1. <?php
  2. /**
  3. * Base static class for performing query and update operations on the 'katao_supplier_invoice' table.
  4. *
  5. *
  6. *
  7. * @package lib.model.om
  8. */
  9. abstract class BaseKataoSupplierInvoicePeer {
  10. /** the default database name for this class */
  11. const DATABASE_NAME = 'propel';
  12. /** the table name for this class */
  13. const TABLE_NAME = 'katao_supplier_invoice';
  14. /** A class that can be returned by this peer. */
  15. const CLASS_DEFAULT = 'lib.model.KataoSupplierInvoice';
  16. /** The total number of columns. */
  17. const NUM_COLUMNS = 43;
  18. /** The number of lazy-loaded columns. */
  19. const NUM_LAZY_LOAD_COLUMNS = 0;
  20. /** the column name for the ID field */
  21. const ID = 'katao_supplier_invoice.ID';
  22. /** the column name for the KATAO_SUPPLIER_ID field */
  23. const KATAO_SUPPLIER_ID = 'katao_supplier_invoice.KATAO_SUPPLIER_ID';
  24. /** the column name for the KATAO_PERIOD_ID field */
  25. const KATAO_PERIOD_ID = 'katao_supplier_invoice.KATAO_PERIOD_ID';
  26. /** the column name for the STATUS field */
  27. const STATUS = 'katao_supplier_invoice.STATUS';
  28. /** the column name for the SUPPLIER_NAME field */
  29. const SUPPLIER_NAME = 'katao_supplier_invoice.SUPPLIER_NAME';
  30. /** the column name for the SUPPLIER_EMAIL field */
  31. const SUPPLIER_EMAIL = 'katao_supplier_invoice.SUPPLIER_EMAIL';
  32. /** the column name for the SUPPLIER_ADDRESS1 field */
  33. const SUPPLIER_ADDRESS1 = 'katao_supplier_invoice.SUPPLIER_ADDRESS1';
  34. /** the column name for the SUPPLIER_ADDRESS2 field */
  35. const SUPPLIER_ADDRESS2 = 'katao_supplier_invoice.SUPPLIER_ADDRESS2';
  36. /** the column name for the SUPPLIER_ZIP field */
  37. const SUPPLIER_ZIP = 'katao_supplier_invoice.SUPPLIER_ZIP';
  38. /** the column name for the SUPPLIER_CITY field */
  39. const SUPPLIER_CITY = 'katao_supplier_invoice.SUPPLIER_CITY';
  40. /** the column name for the KATAO_NAME field */
  41. const KATAO_NAME = 'katao_supplier_invoice.KATAO_NAME';
  42. /** the column name for the KATAO_ADDRESS field */
  43. const KATAO_ADDRESS = 'katao_supplier_invoice.KATAO_ADDRESS';
  44. /** the column name for the KATAO_SIRET_NUMBER field */
  45. const KATAO_SIRET_NUMBER = 'katao_supplier_invoice.KATAO_SIRET_NUMBER';
  46. /** the column name for the KATAO_RCS_NUMBER field */
  47. const KATAO_RCS_NUMBER = 'katao_supplier_invoice.KATAO_RCS_NUMBER';
  48. /** the column name for the KATAO_CAPITAL field */
  49. const KATAO_CAPITAL = 'katao_supplier_invoice.KATAO_CAPITAL';
  50. /** the column name for the REFERENCE field */
  51. const REFERENCE = 'katao_supplier_invoice.REFERENCE';
  52. /** the column name for the INVOICE_DATE field */
  53. const INVOICE_DATE = 'katao_supplier_invoice.INVOICE_DATE';
  54. /** the column name for the DUE_DATE field */
  55. const DUE_DATE = 'katao_supplier_invoice.DUE_DATE';
  56. /** the column name for the PAYMENT_DATE field */
  57. const PAYMENT_DATE = 'katao_supplier_invoice.PAYMENT_DATE';
  58. /** the column name for the PAYMENT_MODE field */
  59. const PAYMENT_MODE = 'katao_supplier_invoice.PAYMENT_MODE';
  60. /** the column name for the PAYMENT_DETAILS field */
  61. const PAYMENT_DETAILS = 'katao_supplier_invoice.PAYMENT_DETAILS';
  62. /** the column name for the PAYMENT_AMOUNT_EURO field */
  63. const PAYMENT_AMOUNT_EURO = 'katao_supplier_invoice.PAYMENT_AMOUNT_EURO';
  64. /** the column name for the PAYMENT_AMOUNT_SOL field */
  65. const PAYMENT_AMOUNT_SOL = 'katao_supplier_invoice.PAYMENT_AMOUNT_SOL';
  66. /** the column name for the TAUX0_BASES_HT field */
  67. const TAUX0_BASES_HT = 'katao_supplier_invoice.TAUX0_BASES_HT';
  68. /** the column name for the TAUX0_DISCOUNT_HT field */
  69. const TAUX0_DISCOUNT_HT = 'katao_supplier_invoice.TAUX0_DISCOUNT_HT';
  70. /** the column name for the TAUX0_AMOUNT field */
  71. const TAUX0_AMOUNT = 'katao_supplier_invoice.TAUX0_AMOUNT';
  72. /** the column name for the TAUX1_BASES_HT field */
  73. const TAUX1_BASES_HT = 'katao_supplier_invoice.TAUX1_BASES_HT';
  74. /** the column name for the TAUX1_DISCOUNT_HT field */
  75. const TAUX1_DISCOUNT_HT = 'katao_supplier_invoice.TAUX1_DISCOUNT_HT';
  76. /** the column name for the TAUX1_AMOUNT field */
  77. const TAUX1_AMOUNT = 'katao_supplier_invoice.TAUX1_AMOUNT';
  78. /** the column name for the TAUX2_BASES_HT field */
  79. const TAUX2_BASES_HT = 'katao_supplier_invoice.TAUX2_BASES_HT';
  80. /** the column name for the TAUX2_DISCOUNT_HT field */
  81. const TAUX2_DISCOUNT_HT = 'katao_supplier_invoice.TAUX2_DISCOUNT_HT';
  82. /** the column name for the TAUX2_AMOUNT field */
  83. const TAUX2_AMOUNT = 'katao_supplier_invoice.TAUX2_AMOUNT';
  84. /** the column name for the TOTAL_HT field */
  85. const TOTAL_HT = 'katao_supplier_invoice.TOTAL_HT';
  86. /** the column name for the TOTAL_TVA field */
  87. const TOTAL_TVA = 'katao_supplier_invoice.TOTAL_TVA';
  88. /** the column name for the COMMENT field */
  89. const COMMENT = 'katao_supplier_invoice.COMMENT';
  90. /** the column name for the FEES_SHIPPING_HT field */
  91. const FEES_SHIPPING_HT = 'katao_supplier_invoice.FEES_SHIPPING_HT';
  92. /** the column name for the FEES_SHIPPING_RATE field */
  93. const FEES_SHIPPING_RATE = 'katao_supplier_invoice.FEES_SHIPPING_RATE';
  94. /** the column name for the FEES_SHIPPING_TVA field */
  95. const FEES_SHIPPING_TVA = 'katao_supplier_invoice.FEES_SHIPPING_TVA';
  96. /** the column name for the FEES_BILLING_HT field */
  97. const FEES_BILLING_HT = 'katao_supplier_invoice.FEES_BILLING_HT';
  98. /** the column name for the FEES_BILLING_RATE field */
  99. const FEES_BILLING_RATE = 'katao_supplier_invoice.FEES_BILLING_RATE';
  100. /** the column name for the FEES_BILLING_TVA field */
  101. const FEES_BILLING_TVA = 'katao_supplier_invoice.FEES_BILLING_TVA';
  102. /** the column name for the CREATED_AT field */
  103. const CREATED_AT = 'katao_supplier_invoice.CREATED_AT';
  104. /** the column name for the UPDATED_AT field */
  105. const UPDATED_AT = 'katao_supplier_invoice.UPDATED_AT';
  106. /** The PHP to DB Name Mapping */
  107. private static $phpNameMap = null;
  108. /**
  109. * holds an array of fieldnames
  110. *
  111. * first dimension keys are the type constants
  112. * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
  113. */
  114. private static $fieldNames = array (
  115. BasePeer::TYPE_PHPNAME => array ('Id', 'KataoSupplierId', 'KataoPeriodId', 'Status', 'SupplierName', 'SupplierEmail', 'SupplierAddress1', 'SupplierAddress2', 'SupplierZip', 'SupplierCity', 'KataoName', 'KataoAddress', 'KataoSiretNumber', 'KataoRcsNumber', 'KataoCapital', 'Reference', 'InvoiceDate', 'DueDate', 'PaymentDate', 'PaymentMode', 'PaymentDetails', 'PaymentAmountEuro', 'PaymentAmountSol', 'Taux0BasesHt', 'Taux0DiscountHt', 'Taux0Amount', 'Taux1BasesHt', 'Taux1DiscountHt', 'Taux1Amount', 'Taux2BasesHt', 'Taux2DiscountHt', 'Taux2Amount', 'TotalHt', 'TotalTva', 'Comment', 'FeesShippingHt', 'FeesShippingRate', 'FeesShippingTva', 'FeesBillingHt', 'FeesBillingRate', 'FeesBillingTva', 'CreatedAt', 'UpdatedAt', ),
  116. BasePeer::TYPE_COLNAME => array (KataoSupplierInvoicePeer::ID, KataoSupplierInvoicePeer::KATAO_SUPPLIER_ID, KataoSupplierInvoicePeer::KATAO_PERIOD_ID, KataoSupplierInvoicePeer::STATUS, KataoSupplierInvoicePeer::SUPPLIER_NAME, KataoSupplierInvoicePeer::SUPPLIER_EMAIL, KataoSupplierInvoicePeer::SUPPLIER_ADDRESS1, KataoSupplierInvoicePeer::SUPPLIER_ADDRESS2, KataoSupplierInvoicePeer::SUPPLIER_ZIP, KataoSupplierInvoicePeer::SUPPLIER_CITY, KataoSupplierInvoicePeer::KATAO_NAME, KataoSupplierInvoicePeer::KATAO_ADDRESS, KataoSupplierInvoicePeer::KATAO_SIRET_NUMBER, KataoSupplierInvoicePeer::KATAO_RCS_NUMBER, KataoSupplierInvoicePeer::KATAO_CAPITAL, KataoSupplierInvoicePeer::REFERENCE, KataoSupplierInvoicePeer::INVOICE_DATE, KataoSupplierInvoicePeer::DUE_DATE, KataoSupplierInvoicePeer::PAYMENT_DATE, KataoSupplierInvoicePeer::PAYMENT_MODE, KataoSupplierInvoicePeer::PAYMENT_DETAILS, KataoSupplierInvoicePeer::PAYMENT_AMOUNT_EURO, KataoSupplierInvoicePeer::PAYMENT_AMOUNT_SOL, KataoSupplierInvoicePeer::TAUX0_BASES_HT, KataoSupplierInvoicePeer::TAUX0_DISCOUNT_HT, KataoSupplierInvoicePeer::TAUX0_AMOUNT, KataoSupplierInvoicePeer::TAUX1_BASES_HT, KataoSupplierInvoicePeer::TAUX1_DISCOUNT_HT, KataoSupplierInvoicePeer::TAUX1_AMOUNT, KataoSupplierInvoicePeer::TAUX2_BASES_HT, KataoSupplierInvoicePeer::TAUX2_DISCOUNT_HT, KataoSupplierInvoicePeer::TAUX2_AMOUNT, KataoSupplierInvoicePeer::TOTAL_HT, KataoSupplierInvoicePeer::TOTAL_TVA, KataoSupplierInvoicePeer::COMMENT, KataoSupplierInvoicePeer::FEES_SHIPPING_HT, KataoSupplierInvoicePeer::FEES_SHIPPING_RATE, KataoSupplierInvoicePeer::FEES_SHIPPING_TVA, KataoSupplierInvoicePeer::FEES_BILLING_HT, KataoSupplierInvoicePeer::FEES_BILLING_RATE, KataoSupplierInvoicePeer::FEES_BILLING_TVA, KataoSupplierInvoicePeer::CREATED_AT, KataoSupplierInvoicePeer::UPDATED_AT, ),
  117. BasePeer::TYPE_FIELDNAME => array ('id', 'katao_supplier_id', 'katao_period_id', 'status', 'supplier_name', 'supplier_email', 'supplier_address1', 'supplier_address2', 'supplier_zip', 'supplier_city', 'katao_name', 'katao_address', 'katao_siret_number', 'katao_rcs_number', 'katao_capital', 'reference', 'invoice_date', 'due_date', 'payment_date', 'payment_mode', 'payment_details', 'payment_amount_euro', 'payment_amount_sol', 'taux0_bases_ht', 'taux0_discount_ht', 'taux0_amount', 'taux1_bases_ht', 'taux1_discount_ht', 'taux1_amount', 'taux2_bases_ht', 'taux2_discount_ht', 'taux2_amount', 'total_ht', 'total_tva', 'comment', 'fees_shipping_ht', 'fees_shipping_rate', 'fees_shipping_tva', 'fees_billing_ht', 'fees_billing_rate', 'fees_billing_tva', 'created_at', 'updated_at', ),
  118. BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, )
  119. );
  120. /**
  121. * holds an array of keys for quick access to the fieldnames array
  122. *
  123. * first dimension keys are the type constants
  124. * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
  125. */
  126. private static $fieldKeys = array (
  127. BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'KataoSupplierId' => 1, 'KataoPeriodId' => 2, 'Status' => 3, 'SupplierName' => 4, 'SupplierEmail' => 5, 'SupplierAddress1' => 6, 'SupplierAddress2' => 7, 'SupplierZip' => 8, 'SupplierCity' => 9, 'KataoName' => 10, 'KataoAddress' => 11, 'KataoSiretNumber' => 12, 'KataoRcsNumber' => 13, 'KataoCapital' => 14, 'Reference' => 15, 'InvoiceDate' => 16, 'DueDate' => 17, 'PaymentDate' => 18, 'PaymentMode' => 19, 'PaymentDetails' => 20, 'PaymentAmountEuro' => 21, 'PaymentAmountSol' => 22, 'Taux0BasesHt' => 23, 'Taux0DiscountHt' => 24, 'Taux0Amount' => 25, 'Taux1BasesHt' => 26, 'Taux1DiscountHt' => 27, 'Taux1Amount' => 28, 'Taux2BasesHt' => 29, 'Taux2DiscountHt' => 30, 'Taux2Amount' => 31, 'TotalHt' => 32, 'TotalTva' => 33, 'Comment' => 34, 'FeesShippingHt' => 35, 'FeesShippingRate' => 36, 'FeesShippingTva' => 37, 'FeesBillingHt' => 38, 'FeesBillingRate' => 39, 'FeesBillingTva' => 40, 'CreatedAt' => 41, 'UpdatedAt' => 42, ),
  128. BasePeer::TYPE_COLNAME => array (KataoSupplierInvoicePeer::ID => 0, KataoSupplierInvoicePeer::KATAO_SUPPLIER_ID => 1, KataoSupplierInvoicePeer::KATAO_PERIOD_ID => 2, KataoSupplierInvoicePeer::STATUS => 3, KataoSupplierInvoicePeer::SUPPLIER_NAME => 4, KataoSupplierInvoicePeer::SUPPLIER_EMAIL => 5, KataoSupplierInvoicePeer::SUPPLIER_ADDRESS1 => 6, KataoSupplierInvoicePeer::SUPPLIER_ADDRESS2 => 7, KataoSupplierInvoicePeer::SUPPLIER_ZIP => 8, KataoSupplierInvoicePeer::SUPPLIER_CITY => 9, KataoSupplierInvoicePeer::KATAO_NAME => 10, KataoSupplierInvoicePeer::KATAO_ADDRESS => 11, KataoSupplierInvoicePeer::KATAO_SIRET_NUMBER => 12, KataoSupplierInvoicePeer::KATAO_RCS_NUMBER => 13, KataoSupplierInvoicePeer::KATAO_CAPITAL => 14, KataoSupplierInvoicePeer::REFERENCE => 15, KataoSupplierInvoicePeer::INVOICE_DATE => 16, KataoSupplierInvoicePeer::DUE_DATE => 17, KataoSupplierInvoicePeer::PAYMENT_DATE => 18, KataoSupplierInvoicePeer::PAYMENT_MODE => 19, KataoSupplierInvoicePeer::PAYMENT_DETAILS => 20, KataoSupplierInvoicePeer::PAYMENT_AMOUNT_EURO => 21, KataoSupplierInvoicePeer::PAYMENT_AMOUNT_SOL => 22, KataoSupplierInvoicePeer::TAUX0_BASES_HT => 23, KataoSupplierInvoicePeer::TAUX0_DISCOUNT_HT => 24, KataoSupplierInvoicePeer::TAUX0_AMOUNT => 25, KataoSupplierInvoicePeer::TAUX1_BASES_HT => 26, KataoSupplierInvoicePeer::TAUX1_DISCOUNT_HT => 27, KataoSupplierInvoicePeer::TAUX1_AMOUNT => 28, KataoSupplierInvoicePeer::TAUX2_BASES_HT => 29, KataoSupplierInvoicePeer::TAUX2_DISCOUNT_HT => 30, KataoSupplierInvoicePeer::TAUX2_AMOUNT => 31, KataoSupplierInvoicePeer::TOTAL_HT => 32, KataoSupplierInvoicePeer::TOTAL_TVA => 33, KataoSupplierInvoicePeer::COMMENT => 34, KataoSupplierInvoicePeer::FEES_SHIPPING_HT => 35, KataoSupplierInvoicePeer::FEES_SHIPPING_RATE => 36, KataoSupplierInvoicePeer::FEES_SHIPPING_TVA => 37, KataoSupplierInvoicePeer::FEES_BILLING_HT => 38, KataoSupplierInvoicePeer::FEES_BILLING_RATE => 39, KataoSupplierInvoicePeer::FEES_BILLING_TVA => 40, KataoSupplierInvoicePeer::CREATED_AT => 41, KataoSupplierInvoicePeer::UPDATED_AT => 42, ),
  129. BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'katao_supplier_id' => 1, 'katao_period_id' => 2, 'status' => 3, 'supplier_name' => 4, 'supplier_email' => 5, 'supplier_address1' => 6, 'supplier_address2' => 7, 'supplier_zip' => 8, 'supplier_city' => 9, 'katao_name' => 10, 'katao_address' => 11, 'katao_siret_number' => 12, 'katao_rcs_number' => 13, 'katao_capital' => 14, 'reference' => 15, 'invoice_date' => 16, 'due_date' => 17, 'payment_date' => 18, 'payment_mode' => 19, 'payment_details' => 20, 'payment_amount_euro' => 21, 'payment_amount_sol' => 22, 'taux0_bases_ht' => 23, 'taux0_discount_ht' => 24, 'taux0_amount' => 25, 'taux1_bases_ht' => 26, 'taux1_discount_ht' => 27, 'taux1_amount' => 28, 'taux2_bases_ht' => 29, 'taux2_discount_ht' => 30, 'taux2_amount' => 31, 'total_ht' => 32, 'total_tva' => 33, 'comment' => 34, 'fees_shipping_ht' => 35, 'fees_shipping_rate' => 36, 'fees_shipping_tva' => 37, 'fees_billing_ht' => 38, 'fees_billing_rate' => 39, 'fees_billing_tva' => 40, 'created_at' => 41, 'updated_at' => 42, ),
  130. BasePeer::TYPE_NUM => array (0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 33, 34, 35, 36, 37, 38, 39, 40, 41, 42, )
  131. );
  132. /**
  133. * @return MapBuilder the map builder for this peer
  134. * @throws PropelException Any exceptions caught during processing will be
  135. * rethrown wrapped into a PropelException.
  136. */
  137. public static function getMapBuilder()
  138. {
  139. return BasePeer::getMapBuilder('lib.model.map.KataoSupplierInvoiceMapBuilder');
  140. }
  141. /**
  142. * Gets a map (hash) of PHP names to DB column names.
  143. *
  144. * @return array The PHP to DB name map for this peer
  145. * @throws PropelException Any exceptions caught during processing will be
  146. * rethrown wrapped into a PropelException.
  147. * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
  148. */
  149. public static function getPhpNameMap()
  150. {
  151. if (self::$phpNameMap === null) {
  152. $map = KataoSupplierInvoicePeer::getTableMap();
  153. $columns = $map->getColumns();
  154. $nameMap = array();
  155. foreach ($columns as $column) {
  156. $nameMap[$column->getPhpName()] = $column->getColumnName();
  157. }
  158. self::$phpNameMap = $nameMap;
  159. }
  160. return self::$phpNameMap;
  161. }
  162. /**
  163. * Translates a fieldname to another type
  164. *
  165. * @param string $name field name
  166. * @param string $fromType One of the class type constants TYPE_PHPNAME,
  167. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  168. * @param string $toType One of the class type constants
  169. * @return string translated name of the field.
  170. */
  171. static public function translateFieldName($name, $fromType, $toType)
  172. {
  173. $toNames = self::getFieldNames($toType);
  174. $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
  175. if ($key === null) {
  176. throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
  177. }
  178. return $toNames[$key];
  179. }
  180. /**
  181. * Returns an array of of field names.
  182. *
  183. * @param string $type The type of fieldnames to return:
  184. * One of the class type constants TYPE_PHPNAME,
  185. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  186. * @return array A list of field names
  187. */
  188. static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
  189. {
  190. if (!array_key_exists($type, self::$fieldNames)) {
  191. throw new PropelException('Method getFieldNames() expects the parameter $type to be one of the class constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM. ' . $type . ' was given.');
  192. }
  193. return self::$fieldNames[$type];
  194. }
  195. /**
  196. * Convenience method which changes table.column to alias.column.
  197. *
  198. * Using this method you can maintain SQL abstraction while using column aliases.
  199. * <code>
  200. * $c->addAlias("alias1", TablePeer::TABLE_NAME);
  201. * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
  202. * </code>
  203. * @param string $alias The alias for the current table.
  204. * @param string $column The column name for current table. (i.e. KataoSupplierInvoicePeer::COLUMN_NAME).
  205. * @return string
  206. */
  207. public static function alias($alias, $column)
  208. {
  209. return str_replace(KataoSupplierInvoicePeer::TABLE_NAME.'.', $alias.'.', $column);
  210. }
  211. /**
  212. * Add all the columns needed to create a new object.
  213. *
  214. * Note: any columns that were marked with lazyLoad="true" in the
  215. * XML schema will not be added to the select list and only loaded
  216. * on demand.
  217. *
  218. * @param criteria object containing the columns to add.
  219. * @throws PropelException Any exceptions caught during processing will be
  220. * rethrown wrapped into a PropelException.
  221. */
  222. public static function addSelectColumns(Criteria $criteria)
  223. {
  224. $criteria->addSelectColumn(KataoSupplierInvoicePeer::ID);
  225. $criteria->addSelectColumn(KataoSupplierInvoicePeer::KATAO_SUPPLIER_ID);
  226. $criteria->addSelectColumn(KataoSupplierInvoicePeer::KATAO_PERIOD_ID);
  227. $criteria->addSelectColumn(KataoSupplierInvoicePeer::STATUS);
  228. $criteria->addSelectColumn(KataoSupplierInvoicePeer::SUPPLIER_NAME);
  229. $criteria->addSelectColumn(KataoSupplierInvoicePeer::SUPPLIER_EMAIL);
  230. $criteria->addSelectColumn(KataoSupplierInvoicePeer::SUPPLIER_ADDRESS1);
  231. $criteria->addSelectColumn(KataoSupplierInvoicePeer::SUPPLIER_ADDRESS2);
  232. $criteria->addSelectColumn(KataoSupplierInvoicePeer::SUPPLIER_ZIP);
  233. $criteria->addSelectColumn(KataoSupplierInvoicePeer::SUPPLIER_CITY);
  234. $criteria->addSelectColumn(KataoSupplierInvoicePeer::KATAO_NAME);
  235. $criteria->addSelectColumn(KataoSupplierInvoicePeer::KATAO_ADDRESS);
  236. $criteria->addSelectColumn(KataoSupplierInvoicePeer::KATAO_SIRET_NUMBER);
  237. $criteria->addSelectColumn(KataoSupplierInvoicePeer::KATAO_RCS_NUMBER);
  238. $criteria->addSelectColumn(KataoSupplierInvoicePeer::KATAO_CAPITAL);
  239. $criteria->addSelectColumn(KataoSupplierInvoicePeer::REFERENCE);
  240. $criteria->addSelectColumn(KataoSupplierInvoicePeer::INVOICE_DATE);
  241. $criteria->addSelectColumn(KataoSupplierInvoicePeer::DUE_DATE);
  242. $criteria->addSelectColumn(KataoSupplierInvoicePeer::PAYMENT_DATE);
  243. $criteria->addSelectColumn(KataoSupplierInvoicePeer::PAYMENT_MODE);
  244. $criteria->addSelectColumn(KataoSupplierInvoicePeer::PAYMENT_DETAILS);
  245. $criteria->addSelectColumn(KataoSupplierInvoicePeer::PAYMENT_AMOUNT_EURO);
  246. $criteria->addSelectColumn(KataoSupplierInvoicePeer::PAYMENT_AMOUNT_SOL);
  247. $criteria->addSelectColumn(KataoSupplierInvoicePeer::TAUX0_BASES_HT);
  248. $criteria->addSelectColumn(KataoSupplierInvoicePeer::TAUX0_DISCOUNT_HT);
  249. $criteria->addSelectColumn(KataoSupplierInvoicePeer::TAUX0_AMOUNT);
  250. $criteria->addSelectColumn(KataoSupplierInvoicePeer::TAUX1_BASES_HT);
  251. $criteria->addSelectColumn(KataoSupplierInvoicePeer::TAUX1_DISCOUNT_HT);
  252. $criteria->addSelectColumn(KataoSupplierInvoicePeer::TAUX1_AMOUNT);
  253. $criteria->addSelectColumn(KataoSupplierInvoicePeer::TAUX2_BASES_HT);
  254. $criteria->addSelectColumn(KataoSupplierInvoicePeer::TAUX2_DISCOUNT_HT);
  255. $criteria->addSelectColumn(KataoSupplierInvoicePeer::TAUX2_AMOUNT);
  256. $criteria->addSelectColumn(KataoSupplierInvoicePeer::TOTAL_HT);
  257. $criteria->addSelectColumn(KataoSupplierInvoicePeer::TOTAL_TVA);
  258. $criteria->addSelectColumn(KataoSupplierInvoicePeer::COMMENT);
  259. $criteria->addSelectColumn(KataoSupplierInvoicePeer::FEES_SHIPPING_HT);
  260. $criteria->addSelectColumn(KataoSupplierInvoicePeer::FEES_SHIPPING_RATE);
  261. $criteria->addSelectColumn(KataoSupplierInvoicePeer::FEES_SHIPPING_TVA);
  262. $criteria->addSelectColumn(KataoSupplierInvoicePeer::FEES_BILLING_HT);
  263. $criteria->addSelectColumn(KataoSupplierInvoicePeer::FEES_BILLING_RATE);
  264. $criteria->addSelectColumn(KataoSupplierInvoicePeer::FEES_BILLING_TVA);
  265. $criteria->addSelectColumn(KataoSupplierInvoicePeer::CREATED_AT);
  266. $criteria->addSelectColumn(KataoSupplierInvoicePeer::UPDATED_AT);
  267. }
  268. const COUNT = 'COUNT(katao_supplier_invoice.ID)';
  269. const COUNT_DISTINCT = 'COUNT(DISTINCT katao_supplier_invoice.ID)';
  270. /**
  271. * Returns the number of rows matching criteria.
  272. *
  273. * @param Criteria $criteria
  274. * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
  275. * @param Connection $con
  276. * @return int Number of matching rows.
  277. */
  278. public static function doCount(Criteria $criteria, $distinct = false, $con = null)
  279. {
  280. // we're going to modify criteria, so copy it first
  281. $criteria = clone $criteria;
  282. // clear out anything that might confuse the ORDER BY clause
  283. $criteria->clearSelectColumns()->clearOrderByColumns();
  284. if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
  285. $criteria->addSelectColumn(KataoSupplierInvoicePeer::COUNT_DISTINCT);
  286. } else {
  287. $criteria->addSelectColumn(KataoSupplierInvoicePeer::COUNT);
  288. }
  289. // just in case we're grouping: add those columns to the select statement
  290. foreach($criteria->getGroupByColumns() as $column)
  291. {
  292. $criteria->addSelectColumn($column);
  293. }
  294. $rs = KataoSupplierInvoicePeer::doSelectRS($criteria, $con);
  295. if ($rs->next()) {
  296. return $rs->getInt(1);
  297. } else {
  298. // no rows returned; we infer that means 0 matches.
  299. return 0;
  300. }
  301. }
  302. /**
  303. * Method to select one object from the DB.
  304. *
  305. * @param Criteria $criteria object used to create the SELECT statement.
  306. * @param Connection $con
  307. * @return KataoSupplierInvoice
  308. * @throws PropelException Any exceptions caught during processing will be
  309. * rethrown wrapped into a PropelException.
  310. */
  311. public static function doSelectOne(Criteria $criteria, $con = null)
  312. {
  313. $critcopy = clone $criteria;
  314. $critcopy->setLimit(1);
  315. $objects = KataoSupplierInvoicePeer::doSelect($critcopy, $con);
  316. if ($objects) {
  317. return $objects[0];
  318. }
  319. return null;
  320. }
  321. /**
  322. * Method to do selects.
  323. *
  324. * @param Criteria $criteria The Criteria object used to build the SELECT statement.
  325. * @param Connection $con
  326. * @return array Array of selected Objects
  327. * @throws PropelException Any exceptions caught during processing will be
  328. * rethrown wrapped into a PropelException.
  329. */
  330. public static function doSelect(Criteria $criteria, $con = null)
  331. {
  332. return KataoSupplierInvoicePeer::populateObjects(KataoSupplierInvoicePeer::doSelectRS($criteria, $con));
  333. }
  334. /**
  335. * Prepares the Criteria object and uses the parent doSelect()
  336. * method to get a ResultSet.
  337. *
  338. * Use this method directly if you want to just get the resultset
  339. * (instead of an array of objects).
  340. *
  341. * @param Criteria $criteria The Criteria object used to build the SELECT statement.
  342. * @param Connection $con the connection to use
  343. * @throws PropelException Any exceptions caught during processing will be
  344. * rethrown wrapped into a PropelException.
  345. * @return ResultSet The resultset object with numerically-indexed fields.
  346. * @see BasePeer::doSelect()
  347. */
  348. public static function doSelectRS(Criteria $criteria, $con = null)
  349. {
  350. foreach (sfMixer::getCallables('BaseKataoSupplierInvoicePeer:doSelectRS:doSelectRS') as $callable)
  351. {
  352. call_user_func($callable, 'BaseKataoSupplierInvoicePeer', $criteria, $con);
  353. }
  354. if ($con === null) {
  355. $con = Propel::getConnection(self::DATABASE_NAME);
  356. }
  357. if (!$criteria->getSelectColumns()) {
  358. $criteria = clone $criteria;
  359. KataoSupplierInvoicePeer::addSelectColumns($criteria);
  360. }
  361. // Set the correct dbName
  362. $criteria->setDbName(self::DATABASE_NAME);
  363. // BasePeer returns a Creole ResultSet, set to return
  364. // rows indexed numerically.
  365. return BasePeer::doSelect($criteria, $con);
  366. }
  367. /**
  368. * The returned array will contain objects of the default type or
  369. * objects that inherit from the default.
  370. *
  371. * @throws PropelException Any exceptions caught during processing will be
  372. * rethrown wrapped into a PropelException.
  373. */
  374. public static function populateObjects(ResultSet $rs)
  375. {
  376. $results = array();
  377. // set the class once to avoid overhead in the loop
  378. $cls = KataoSupplierInvoicePeer::getOMClass();
  379. $cls = sfPropel::import($cls);
  380. // populate the object(s)
  381. while($rs->next()) {
  382. $obj = new $cls();
  383. $obj->hydrate($rs);
  384. $results[] = $obj;
  385. }
  386. return $results;
  387. }
  388. /**
  389. * Returns the number of rows matching criteria, joining the related KataoSupplier table
  390. *
  391. * @param Criteria $c
  392. * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
  393. * @param Connection $con
  394. * @return int Number of matching rows.
  395. */
  396. public static function doCountJoinKataoSupplier(Criteria $criteria, $distinct = false, $con = null)
  397. {
  398. // we're going to modify criteria, so copy it first
  399. $criteria = clone $criteria;
  400. // clear out anything that might confuse the ORDER BY clause
  401. $criteria->clearSelectColumns()->clearOrderByColumns();
  402. if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
  403. $criteria->addSelectColumn(KataoSupplierInvoicePeer::COUNT_DISTINCT);
  404. } else {
  405. $criteria->addSelectColumn(KataoSupplierInvoicePeer::COUNT);
  406. }
  407. // just in case we're grouping: add those columns to the select statement
  408. foreach($criteria->getGroupByColumns() as $column)
  409. {
  410. $criteria->addSelectColumn($column);
  411. }
  412. $criteria->addJoin(KataoSupplierInvoicePeer::KATAO_SUPPLIER_ID, KataoSupplierPeer::ID);
  413. $rs = KataoSupplierInvoicePeer::doSelectRS($criteria, $con);
  414. if ($rs->next()) {
  415. return $rs->getInt(1);
  416. } else {
  417. // no rows returned; we infer that means 0 matches.
  418. return 0;
  419. }
  420. }
  421. /**
  422. * Returns the number of rows matching criteria, joining the related KataoPeriod table
  423. *
  424. * @param Criteria $c
  425. * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
  426. * @param Connection $con
  427. * @return int Number of matching rows.
  428. */
  429. public static function doCountJoinKataoPeriod(Criteria $criteria, $distinct = false, $con = null)
  430. {
  431. // we're going to modify criteria, so copy it first
  432. $criteria = clone $criteria;
  433. // clear out anything that might confuse the ORDER BY clause
  434. $criteria->clearSelectColumns()->clearOrderByColumns();
  435. if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
  436. $criteria->addSelectColumn(KataoSupplierInvoicePeer::COUNT_DISTINCT);
  437. } else {
  438. $criteria->addSelectColumn(KataoSupplierInvoicePeer::COUNT);
  439. }
  440. // just in case we're grouping: add those columns to the select statement
  441. foreach($criteria->getGroupByColumns() as $column)
  442. {
  443. $criteria->addSelectColumn($column);
  444. }
  445. $criteria->addJoin(KataoSupplierInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  446. $rs = KataoSupplierInvoicePeer::doSelectRS($criteria, $con);
  447. if ($rs->next()) {
  448. return $rs->getInt(1);
  449. } else {
  450. // no rows returned; we infer that means 0 matches.
  451. return 0;
  452. }
  453. }
  454. /**
  455. * Selects a collection of KataoSupplierInvoice objects pre-filled with their KataoSupplier objects.
  456. *
  457. * @return array Array of KataoSupplierInvoice objects.
  458. * @throws PropelException Any exceptions caught during processing will be
  459. * rethrown wrapped into a PropelException.
  460. */
  461. public static function doSelectJoinKataoSupplier(Criteria $c, $con = null)
  462. {
  463. foreach (sfMixer::getCallables('BaseKataoSupplierInvoicePeer:doSelectJoin:doSelectJoin') as $callable)
  464. {
  465. call_user_func($callable, 'BaseKataoSupplierInvoicePeer', $c, $con);
  466. }
  467. $c = clone $c;
  468. // Set the correct dbName if it has not been overridden
  469. if ($c->getDbName() == Propel::getDefaultDB()) {
  470. $c->setDbName(self::DATABASE_NAME);
  471. }
  472. KataoSupplierInvoicePeer::addSelectColumns($c);
  473. $startcol = (KataoSupplierInvoicePeer::NUM_COLUMNS - KataoSupplierInvoicePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
  474. KataoSupplierPeer::addSelectColumns($c);
  475. $c->addJoin(KataoSupplierInvoicePeer::KATAO_SUPPLIER_ID, KataoSupplierPeer::ID);
  476. $rs = BasePeer::doSelect($c, $con);
  477. $results = array();
  478. while($rs->next()) {
  479. $omClass = KataoSupplierInvoicePeer::getOMClass();
  480. $cls = sfPropel::import($omClass);
  481. $obj1 = new $cls();
  482. $obj1->hydrate($rs);
  483. $omClass = KataoSupplierPeer::getOMClass();
  484. $cls = sfPropel::import($omClass);
  485. $obj2 = new $cls();
  486. $obj2->hydrate($rs, $startcol);
  487. $newObject = true;
  488. foreach($results as $temp_obj1) {
  489. $temp_obj2 = $temp_obj1->getKataoSupplier(); //CHECKME
  490. if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
  491. $newObject = false;
  492. // e.g. $author->addBookRelatedByBookId()
  493. $temp_obj2->addKataoSupplierInvoice($obj1); //CHECKME
  494. break;
  495. }
  496. }
  497. if ($newObject) {
  498. $obj2->initKataoSupplierInvoices();
  499. $obj2->addKataoSupplierInvoice($obj1); //CHECKME
  500. }
  501. $results[] = $obj1;
  502. }
  503. return $results;
  504. }
  505. /**
  506. * Selects a collection of KataoSupplierInvoice objects pre-filled with their KataoPeriod objects.
  507. *
  508. * @return array Array of KataoSupplierInvoice objects.
  509. * @throws PropelException Any exceptions caught during processing will be
  510. * rethrown wrapped into a PropelException.
  511. */
  512. public static function doSelectJoinKataoPeriod(Criteria $c, $con = null)
  513. {
  514. foreach (sfMixer::getCallables('BaseKataoSupplierInvoicePeer:doSelectJoin:doSelectJoin') as $callable)
  515. {
  516. call_user_func($callable, 'BaseKataoSupplierInvoicePeer', $c, $con);
  517. }
  518. $c = clone $c;
  519. // Set the correct dbName if it has not been overridden
  520. if ($c->getDbName() == Propel::getDefaultDB()) {
  521. $c->setDbName(self::DATABASE_NAME);
  522. }
  523. KataoSupplierInvoicePeer::addSelectColumns($c);
  524. $startcol = (KataoSupplierInvoicePeer::NUM_COLUMNS - KataoSupplierInvoicePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
  525. KataoPeriodPeer::addSelectColumns($c);
  526. $c->addJoin(KataoSupplierInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  527. $rs = BasePeer::doSelect($c, $con);
  528. $results = array();
  529. while($rs->next()) {
  530. $omClass = KataoSupplierInvoicePeer::getOMClass();
  531. $cls = sfPropel::import($omClass);
  532. $obj1 = new $cls();
  533. $obj1->hydrate($rs);
  534. $omClass = KataoPeriodPeer::getOMClass();
  535. $cls = sfPropel::import($omClass);
  536. $obj2 = new $cls();
  537. $obj2->hydrate($rs, $startcol);
  538. $newObject = true;
  539. foreach($results as $temp_obj1) {
  540. $temp_obj2 = $temp_obj1->getKataoPeriod(); //CHECKME
  541. if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
  542. $newObject = false;
  543. // e.g. $author->addBookRelatedByBookId()
  544. $temp_obj2->addKataoSupplierInvoice($obj1); //CHECKME
  545. break;
  546. }
  547. }
  548. if ($newObject) {
  549. $obj2->initKataoSupplierInvoices();
  550. $obj2->addKataoSupplierInvoice($obj1); //CHECKME
  551. }
  552. $results[] = $obj1;
  553. }
  554. return $results;
  555. }
  556. /**
  557. * Returns the number of rows matching criteria, joining all related tables
  558. *
  559. * @param Criteria $c
  560. * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
  561. * @param Connection $con
  562. * @return int Number of matching rows.
  563. */
  564. public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
  565. {
  566. $criteria = clone $criteria;
  567. // clear out anything that might confuse the ORDER BY clause
  568. $criteria->clearSelectColumns()->clearOrderByColumns();
  569. if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
  570. $criteria->addSelectColumn(KataoSupplierInvoicePeer::COUNT_DISTINCT);
  571. } else {
  572. $criteria->addSelectColumn(KataoSupplierInvoicePeer::COUNT);
  573. }
  574. // just in case we're grouping: add those columns to the select statement
  575. foreach($criteria->getGroupByColumns() as $column)
  576. {
  577. $criteria->addSelectColumn($column);
  578. }
  579. $criteria->addJoin(KataoSupplierInvoicePeer::KATAO_SUPPLIER_ID, KataoSupplierPeer::ID);
  580. $criteria->addJoin(KataoSupplierInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  581. $rs = KataoSupplierInvoicePeer::doSelectRS($criteria, $con);
  582. if ($rs->next()) {
  583. return $rs->getInt(1);
  584. } else {
  585. // no rows returned; we infer that means 0 matches.
  586. return 0;
  587. }
  588. }
  589. /**
  590. * Selects a collection of KataoSupplierInvoice objects pre-filled with all related objects.
  591. *
  592. * @return array Array of KataoSupplierInvoice objects.
  593. * @throws PropelException Any exceptions caught during processing will be
  594. * rethrown wrapped into a PropelException.
  595. */
  596. public static function doSelectJoinAll(Criteria $c, $con = null)
  597. {
  598. foreach (sfMixer::getCallables('BaseKataoSupplierInvoicePeer:doSelectJoinAll:doSelectJoinAll') as $callable)
  599. {
  600. call_user_func($callable, 'BaseKataoSupplierInvoicePeer', $c, $con);
  601. }
  602. $c = clone $c;
  603. // Set the correct dbName if it has not been overridden
  604. if ($c->getDbName() == Propel::getDefaultDB()) {
  605. $c->setDbName(self::DATABASE_NAME);
  606. }
  607. KataoSupplierInvoicePeer::addSelectColumns($c);
  608. $startcol2 = (KataoSupplierInvoicePeer::NUM_COLUMNS - KataoSupplierInvoicePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
  609. KataoSupplierPeer::addSelectColumns($c);
  610. $startcol3 = $startcol2 + KataoSupplierPeer::NUM_COLUMNS;
  611. KataoPeriodPeer::addSelectColumns($c);
  612. $startcol4 = $startcol3 + KataoPeriodPeer::NUM_COLUMNS;
  613. $c->addJoin(KataoSupplierInvoicePeer::KATAO_SUPPLIER_ID, KataoSupplierPeer::ID);
  614. $c->addJoin(KataoSupplierInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  615. $rs = BasePeer::doSelect($c, $con);
  616. $results = array();
  617. while($rs->next()) {
  618. $omClass = KataoSupplierInvoicePeer::getOMClass();
  619. $cls = sfPropel::import($omClass);
  620. $obj1 = new $cls();
  621. $obj1->hydrate($rs);
  622. // Add objects for joined KataoSupplier rows
  623. $omClass = KataoSupplierPeer::getOMClass();
  624. $cls = sfPropel::import($omClass);
  625. $obj2 = new $cls();
  626. $obj2->hydrate($rs, $startcol2);
  627. $newObject = true;
  628. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  629. $temp_obj1 = $results[$j];
  630. $temp_obj2 = $temp_obj1->getKataoSupplier(); // CHECKME
  631. if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
  632. $newObject = false;
  633. $temp_obj2->addKataoSupplierInvoice($obj1); // CHECKME
  634. break;
  635. }
  636. }
  637. if ($newObject) {
  638. $obj2->initKataoSupplierInvoices();
  639. $obj2->addKataoSupplierInvoice($obj1);
  640. }
  641. // Add objects for joined KataoPeriod rows
  642. $omClass = KataoPeriodPeer::getOMClass();
  643. $cls = sfPropel::import($omClass);
  644. $obj3 = new $cls();
  645. $obj3->hydrate($rs, $startcol3);
  646. $newObject = true;
  647. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  648. $temp_obj1 = $results[$j];
  649. $temp_obj3 = $temp_obj1->getKataoPeriod(); // CHECKME
  650. if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
  651. $newObject = false;
  652. $temp_obj3->addKataoSupplierInvoice($obj1); // CHECKME
  653. break;
  654. }
  655. }
  656. if ($newObject) {
  657. $obj3->initKataoSupplierInvoices();
  658. $obj3->addKataoSupplierInvoice($obj1);
  659. }
  660. $results[] = $obj1;
  661. }
  662. return $results;
  663. }
  664. /**
  665. * Returns the number of rows matching criteria, joining the related KataoSupplier table
  666. *
  667. * @param Criteria $c
  668. * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
  669. * @param Connection $con
  670. * @return int Number of matching rows.
  671. */
  672. public static function doCountJoinAllExceptKataoSupplier(Criteria $criteria, $distinct = false, $con = null)
  673. {
  674. // we're going to modify criteria, so copy it first
  675. $criteria = clone $criteria;
  676. // clear out anything that might confuse the ORDER BY clause
  677. $criteria->clearSelectColumns()->clearOrderByColumns();
  678. if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
  679. $criteria->addSelectColumn(KataoSupplierInvoicePeer::COUNT_DISTINCT);
  680. } else {
  681. $criteria->addSelectColumn(KataoSupplierInvoicePeer::COUNT);
  682. }
  683. // just in case we're grouping: add those columns to the select statement
  684. foreach($criteria->getGroupByColumns() as $column)
  685. {
  686. $criteria->addSelectColumn($column);
  687. }
  688. $criteria->addJoin(KataoSupplierInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  689. $rs = KataoSupplierInvoicePeer::doSelectRS($criteria, $con);
  690. if ($rs->next()) {
  691. return $rs->getInt(1);
  692. } else {
  693. // no rows returned; we infer that means 0 matches.
  694. return 0;
  695. }
  696. }
  697. /**
  698. * Returns the number of rows matching criteria, joining the related KataoPeriod table
  699. *
  700. * @param Criteria $c
  701. * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
  702. * @param Connection $con
  703. * @return int Number of matching rows.
  704. */
  705. public static function doCountJoinAllExceptKataoPeriod(Criteria $criteria, $distinct = false, $con = null)
  706. {
  707. // we're going to modify criteria, so copy it first
  708. $criteria = clone $criteria;
  709. // clear out anything that might confuse the ORDER BY clause
  710. $criteria->clearSelectColumns()->clearOrderByColumns();
  711. if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
  712. $criteria->addSelectColumn(KataoSupplierInvoicePeer::COUNT_DISTINCT);
  713. } else {
  714. $criteria->addSelectColumn(KataoSupplierInvoicePeer::COUNT);
  715. }
  716. // just in case we're grouping: add those columns to the select statement
  717. foreach($criteria->getGroupByColumns() as $column)
  718. {
  719. $criteria->addSelectColumn($column);
  720. }
  721. $criteria->addJoin(KataoSupplierInvoicePeer::KATAO_SUPPLIER_ID, KataoSupplierPeer::ID);
  722. $rs = KataoSupplierInvoicePeer::doSelectRS($criteria, $con);
  723. if ($rs->next()) {
  724. return $rs->getInt(1);
  725. } else {
  726. // no rows returned; we infer that means 0 matches.
  727. return 0;
  728. }
  729. }
  730. /**
  731. * Selects a collection of KataoSupplierInvoice objects pre-filled with all related objects except KataoSupplier.
  732. *
  733. * @return array Array of KataoSupplierInvoice objects.
  734. * @throws PropelException Any exceptions caught during processing will be
  735. * rethrown wrapped into a PropelException.
  736. */
  737. public static function doSelectJoinAllExceptKataoSupplier(Criteria $c, $con = null)
  738. {
  739. foreach (sfMixer::getCallables('BaseKataoSupplierInvoicePeer:doSelectJoinAllExcept:doSelectJoinAllExcept') as $callable)
  740. {
  741. call_user_func($callable, 'BaseKataoSupplierInvoicePeer', $c, $con);
  742. }
  743. $c = clone $c;
  744. // Set the correct dbName if it has not been overridden
  745. // $c->getDbName() will return the same object if not set to another value
  746. // so == check is okay and faster
  747. if ($c->getDbName() == Propel::getDefaultDB()) {
  748. $c->setDbName(self::DATABASE_NAME);
  749. }
  750. KataoSupplierInvoicePeer::addSelectColumns($c);
  751. $startcol2 = (KataoSupplierInvoicePeer::NUM_COLUMNS - KataoSupplierInvoicePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
  752. KataoPeriodPeer::addSelectColumns($c);
  753. $startcol3 = $startcol2 + KataoPeriodPeer::NUM_COLUMNS;
  754. $c->addJoin(KataoSupplierInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  755. $rs = BasePeer::doSelect($c, $con);
  756. $results = array();
  757. while($rs->next()) {
  758. $omClass = KataoSupplierInvoicePeer::getOMClass();
  759. $cls = sfPropel::import($omClass);
  760. $obj1 = new $cls();
  761. $obj1->hydrate($rs);
  762. $omClass = KataoPeriodPeer::getOMClass();
  763. $cls = sfPropel::import($omClass);
  764. $obj2 = new $cls();
  765. $obj2->hydrate($rs, $startcol2);
  766. $newObject = true;
  767. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  768. $temp_obj1 = $results[$j];
  769. $temp_obj2 = $temp_obj1->getKataoPeriod(); //CHECKME
  770. if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
  771. $newObject = false;
  772. $temp_obj2->addKataoSupplierInvoice($obj1);
  773. break;
  774. }
  775. }
  776. if ($newObject) {
  777. $obj2->initKataoSupplierInvoices();
  778. $obj2->addKataoSupplierInvoice($obj1);
  779. }
  780. $results[] = $obj1;
  781. }
  782. return $results;
  783. }
  784. /**
  785. * Selects a collection of KataoSupplierInvoice objects pre-filled with all related objects except KataoPeriod.
  786. *
  787. * @return array Array of KataoSupplierInvoice objects.
  788. * @throws PropelException Any exceptions caught during processing will be
  789. * rethrown wrapped into a PropelException.
  790. */
  791. public static function doSelectJoinAllExceptKataoPeriod(Criteria $c, $con = null)
  792. {
  793. foreach (sfMixer::getCallables('BaseKataoSupplierInvoicePeer:doSelectJoinAllExcept:doSelectJoinAllExcept') as $callable)
  794. {
  795. call_user_func($callable, 'BaseKataoSupplierInvoicePeer', $c, $con);
  796. }
  797. $c = clone $c;
  798. // Set the correct dbName if it has not been overridden
  799. // $c->getDbName() will return the same object if not set to another value
  800. // so == check is okay and faster
  801. if ($c->getDbName() == Propel::getDefaultDB()) {
  802. $c->setDbName(self::DATABASE_NAME);
  803. }
  804. KataoSupplierInvoicePeer::addSelectColumns($c);
  805. $startcol2 = (KataoSupplierInvoicePeer::NUM_COLUMNS - KataoSupplierInvoicePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
  806. KataoSupplierPeer::addSelectColumns($c);
  807. $startcol3 = $startcol2 + KataoSupplierPeer::NUM_COLUMNS;
  808. $c->addJoin(KataoSupplierInvoicePeer::KATAO_SUPPLIER_ID, KataoSupplierPeer::ID);
  809. $rs = BasePeer::doSelect($c, $con);
  810. $results = array();
  811. while($rs->next()) {
  812. $omClass = KataoSupplierInvoicePeer::getOMClass();
  813. $cls = sfPropel::import($omClass);
  814. $obj1 = new $cls();
  815. $obj1->hydrate($rs);
  816. $omClass = KataoSupplierPeer::getOMClass();
  817. $cls = sfPropel::import($omClass);
  818. $obj2 = new $cls();
  819. $obj2->hydrate($rs, $startcol2);
  820. $newObject = true;
  821. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  822. $temp_obj1 = $results[$j];
  823. $temp_obj2 = $temp_obj1->getKataoSupplier(); //CHECKME
  824. if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
  825. $newObject = false;
  826. $temp_obj2->addKataoSupplierInvoice($obj1);
  827. break;
  828. }
  829. }
  830. if ($newObject) {
  831. $obj2->initKataoSupplierInvoices();
  832. $obj2->addKataoSupplierInvoice($obj1);
  833. }
  834. $results[] = $obj1;
  835. }
  836. return $results;
  837. }
  838. static public function getUniqueColumnNames()
  839. {
  840. return array();
  841. }
  842. /**
  843. * Returns the TableMap related to this peer.
  844. * This method is not needed for general use but a specific application could have a need.
  845. * @return TableMap
  846. * @throws PropelException Any exceptions caught during processing will be
  847. * rethrown wrapped into a PropelException.
  848. */
  849. public static function getTableMap()
  850. {
  851. return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
  852. }
  853. /**
  854. * The class that the Peer will make instances of.
  855. *
  856. * This uses a dot-path notation which is tranalted into a path
  857. * relative to a location on the PHP include_path.
  858. * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
  859. *
  860. * @return string path.to.ClassName
  861. */
  862. public static function getOMClass()
  863. {
  864. return KataoSupplierInvoicePeer::CLASS_DEFAULT;
  865. }
  866. /**
  867. * Method perform an INSERT on the database, given a KataoSupplierInvoice or Criteria object.
  868. *
  869. * @param mixed $values Criteria or KataoSupplierInvoice object containing data that is used to create the INSERT statement.
  870. * @param Connection $con the connection to use
  871. * @return mixed The new primary key.
  872. * @throws PropelException Any exceptions caught during processing will be
  873. * rethrown wrapped into a PropelException.
  874. */
  875. public static function doInsert($values, $con = null)
  876. {
  877. foreach (sfMixer::getCallables('BaseKataoSupplierInvoicePeer:doInsert:pre') as $callable)
  878. {
  879. $ret = call_user_func($callable, 'BaseKataoSupplierInvoicePeer', $values, $con);
  880. if (false !== $ret)
  881. {
  882. return $ret;
  883. }
  884. }
  885. if ($con === null) {
  886. $con = Propel::getConnection(self::DATABASE_NAME);
  887. }
  888. if ($values instanceof Criteria) {
  889. $criteria = clone $values; // rename for clarity
  890. } else {
  891. $criteria = $values->buildCriteria(); // build Criteria from KataoSupplierInvoice object
  892. }
  893. $criteria->remove(KataoSupplierInvoicePeer::ID); // remove pkey col since this table uses auto-increment
  894. // Set the correct dbName
  895. $criteria->setDbName(self::DATABASE_NAME);
  896. try {
  897. // use transaction because $criteria could contain info
  898. // for more than one table (I guess, conceivably)
  899. $con->begin();
  900. $pk = BasePeer::doInsert($criteria, $con);
  901. $con->commit();
  902. } catch(PropelException $e) {
  903. $con->rollback();
  904. throw $e;
  905. }
  906. foreach (sfMixer::getCallables('BaseKataoSupplierInvoicePeer:doInsert:post') as $callable)
  907. {
  908. call_user_func($callable, 'BaseKataoSupplierInvoicePeer', $values, $con, $pk);
  909. }
  910. return $pk;
  911. }
  912. /**
  913. * Method perform an UPDATE on the database, given a KataoSupplierInvoice or Criteria object.
  914. *
  915. * @param mixed $values Criteria or KataoSupplierInvoice object containing data that is used to create the UPDATE statement.
  916. * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
  917. * @return int The number of affected rows (if supported by underlying database driver).
  918. * @throws PropelException Any exceptions caught during processing will be
  919. * rethrown wrapped into a PropelException.
  920. */
  921. public static function doUpdate($values, $con = null)
  922. {
  923. foreach (sfMixer::getCallables('BaseKataoSupplierInvoicePeer:doUpdate:pre') as $callable)
  924. {
  925. $ret = call_user_func($callable, 'BaseKataoSupplierInvoicePeer', $values, $con);
  926. if (false !== $ret)
  927. {
  928. return $ret;
  929. }
  930. }
  931. if ($con === null) {
  932. $con = Propel::getConnection(self::DATABASE_NAME);
  933. }
  934. $selectCriteria = new Criteria(self::DATABASE_NAME);
  935. if ($values instanceof Criteria) {
  936. $criteria = clone $values; // rename for clarity
  937. $comparison = $criteria->getComparison(KataoSupplierInvoicePeer::ID);
  938. $selectCriteria->add(KataoSupplierInvoicePeer::ID, $criteria->remove(KataoSupplierInvoicePeer::ID), $comparison);
  939. } else { // $values is KataoSupplierInvoice object
  940. $criteria = $values->buildCriteria(); // gets full criteria
  941. $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
  942. }
  943. // set the correct dbName
  944. $criteria->setDbName(self::DATABASE_NAME);
  945. $ret = BasePeer::doUpdate($selectCriteria, $criteria, $con);
  946. foreach (sfMixer::getCallables('BaseKataoSupplierInvoicePeer:doUpdate:post') as $callable)
  947. {
  948. call_user_func($callable, 'BaseKataoSupplierInvoicePeer', $values, $con, $ret);
  949. }
  950. return $ret;
  951. }
  952. /**
  953. * Method to DELETE all rows from the katao_supplier_invoice table.
  954. *
  955. * @return int The number of affected rows (if supported by underlying database driver).
  956. */
  957. public static function doDeleteAll($con = null)
  958. {
  959. if ($con === null) {
  960. $con = Propel::getConnection(self::DATABASE_NAME);
  961. }
  962. $affectedRows = 0; // initialize var to track total num of affected rows
  963. try {
  964. // use transaction because $criteria could contain info
  965. // for more than one table or we could emulating ON DELETE CASCADE, etc.
  966. $con->begin();
  967. $affectedRows += BasePeer::doDeleteAll(KataoSupplierInvoicePeer::TABLE_NAME, $con);
  968. $con->commit();
  969. return $affectedRows;
  970. } catch (PropelException $e) {
  971. $con->rollback();
  972. throw $e;
  973. }
  974. }
  975. /**
  976. * Method perform a DELETE on the database, given a KataoSupplierInvoice or Criteria object OR a primary key value.
  977. *
  978. * @param mixed $values Criteria or KataoSupplierInvoice object or primary key or array of primary keys
  979. * which is used to create the DELETE statement
  980. * @param Connection $con the connection to use
  981. * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
  982. * if supported by native driver or if emulated using Propel.
  983. * @throws PropelException Any exceptions caught during processing will be
  984. * rethrown wrapped into a PropelException.
  985. */
  986. public static function doDelete($values, $con = null)
  987. {
  988. if ($con === null) {
  989. $con = Propel::getConnection(KataoSupplierInvoicePeer::DATABASE_NAME);
  990. }
  991. if ($values instanceof Criteria) {
  992. $criteria = clone $values; // rename for clarity
  993. } elseif ($values instanceof KataoSupplierInvoice) {
  994. $criteria = $values->buildPkeyCriteria();
  995. } else {
  996. // it must be the primary key
  997. $criteria = new Criteria(self::DATABASE_NAME);
  998. $criteria->add(KataoSupplierInvoicePeer::ID, (array) $values, Criteria::IN);
  999. }
  1000. // Set the correct dbName
  1001. $criteria->setDbName(self::DATABASE_NAME);
  1002. $affectedRows = 0; // initialize var to track total num of affected rows
  1003. try {
  1004. // use transaction because $criteria could contain info
  1005. // for more than one table or we could emulating ON DELETE CASCADE, etc.
  1006. $con->begin();
  1007. $affectedRows += BasePeer::doDelete($criteria, $con);
  1008. $con->commit();
  1009. return $affectedRows;
  1010. } catch (PropelException $e) {
  1011. $con->rollback();
  1012. throw $e;
  1013. }
  1014. }
  1015. /**
  1016. * Validates all modified columns of given KataoSupplierInvoice object.
  1017. * If parameter $columns is either a single column name or an array of column names
  1018. * than only those columns are validated.
  1019. *
  1020. * NOTICE: This does not apply to primary or foreign keys for now.
  1021. *
  1022. * @param KataoSupplierInvoice $obj The object to validate.
  1023. * @param mixed $cols Column name or array of column names.
  1024. *
  1025. * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
  1026. */
  1027. public static function doValidate(KataoSupplierInvoice $obj, $cols = null)
  1028. {
  1029. $columns = array();
  1030. if ($cols) {
  1031. $dbMap = Propel::getDatabaseMap(KataoSupplierInvoicePeer::DATABASE_NAME);
  1032. $tableMap = $dbMap->getTable(KataoSupplierInvoicePeer::TABLE_NAME);
  1033. if (! is_array($cols)) {
  1034. $cols = array($cols);
  1035. }
  1036. foreach($cols as $colName) {
  1037. if ($tableMap->containsColumn($colName)) {
  1038. $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
  1039. $columns[$colName] = $obj->$get();
  1040. }
  1041. }
  1042. } else {
  1043. }
  1044. $res = BasePeer::doValidate(KataoSupplierInvoicePeer::DATABASE_NAME, KataoSupplierInvoicePeer::TABLE_NAME, $columns);
  1045. if ($res !== true) {
  1046. $request = sfContext::getInstance()->getRequest();
  1047. foreach ($res as $failed) {
  1048. $col = KataoSupplierInvoicePeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
  1049. $request->setError($col, $failed->getMessage());
  1050. }
  1051. }
  1052. return $res;
  1053. }
  1054. /**
  1055. * Retrieve a single object by pkey.
  1056. *
  1057. * @param mixed $pk the primary key.
  1058. * @param Connection $con the connection to use
  1059. * @return KataoSupplierInvoice
  1060. */
  1061. public static function retrieveByPK($pk, $con = null)
  1062. {
  1063. if ($con === null) {
  1064. $con = Propel::getConnection(self::DATABASE_NAME);
  1065. }
  1066. $criteria = new Criteria(KataoSupplierInvoicePeer::DATABASE_NAME);
  1067. $criteria->add(KataoSupplierInvoicePeer::ID, $pk);
  1068. $v = KataoSupplierInvoicePeer::doSelect($criteria, $con);
  1069. return !empty($v) > 0 ? $v[0] : null;
  1070. }
  1071. /**
  1072. * Retrieve multiple objects by pkey.
  1073. *
  1074. * @param array $pks List of primary keys
  1075. * @param Connection $con the connection to use
  1076. * @throws PropelException Any exceptions caught during processing will be
  1077. * rethrown wrapped into a PropelException.
  1078. */
  1079. public static function retrieveByPKs($pks, $con = null)
  1080. {
  1081. if ($con === null) {
  1082. $con = Propel::getConnection(self::DATABASE_NAME);
  1083. }
  1084. $objs = null;
  1085. if (empty($pks)) {
  1086. $objs = array();
  1087. } else {
  1088. $criteria = new Criteria();
  1089. $criteria->add(KataoSupplierInvoicePeer::ID, $pks, Criteria::IN);
  1090. $objs = KataoSupplierInvoicePeer::doSelect($criteria, $con);
  1091. }
  1092. return $objs;
  1093. }
  1094. } // BaseKataoSupplierInvoicePeer
  1095. // static code to register the map builder for this Peer with the main Propel class
  1096. if (Propel::isInit()) {
  1097. // the MapBuilder classes register themselves with Propel during initialization
  1098. // so we need to load them here.
  1099. try {
  1100. BaseKataoSupplierInvoicePeer::getMapBuilder();
  1101. } catch (Exception $e) {
  1102. Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
  1103. }
  1104. } else {
  1105. // even if Propel is not yet initialized, the map builder class can be registered
  1106. // now and then it will be loaded when Propel initializes.
  1107. Propel::registerMapBuilder('lib.model.map.KataoSupplierInvoiceMapBuilder');
  1108. }