BaseKataoInvoicePeer.php 62 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037
  1. <?php
  2. /**
  3. * Base static class for performing query and update operations on the 'katao_invoice' table.
  4. *
  5. *
  6. *
  7. * @package lib.model.om
  8. */
  9. abstract class BaseKataoInvoicePeer {
  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_invoice';
  14. /** A class that can be returned by this peer. */
  15. const CLASS_DEFAULT = 'lib.model.KataoInvoice';
  16. /** The total number of columns. */
  17. const NUM_COLUMNS = 21;
  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_invoice.ID';
  22. /** the column name for the KATAO_MEMBER_ID field */
  23. const KATAO_MEMBER_ID = 'katao_invoice.KATAO_MEMBER_ID';
  24. /** the column name for the KATAO_PERIOD_ID field */
  25. const KATAO_PERIOD_ID = 'katao_invoice.KATAO_PERIOD_ID';
  26. /** the column name for the KATAO_NODE_ID field */
  27. const KATAO_NODE_ID = 'katao_invoice.KATAO_NODE_ID';
  28. /** the column name for the KATAO_CART_ID field */
  29. const KATAO_CART_ID = 'katao_invoice.KATAO_CART_ID';
  30. /** the column name for the STATUS field */
  31. const STATUS = 'katao_invoice.STATUS';
  32. /** the column name for the MEMBER_FIRST_NAME field */
  33. const MEMBER_FIRST_NAME = 'katao_invoice.MEMBER_FIRST_NAME';
  34. /** the column name for the MEMBER_LAST_NAME field */
  35. const MEMBER_LAST_NAME = 'katao_invoice.MEMBER_LAST_NAME';
  36. /** the column name for the MEMBER_EMAIL field */
  37. const MEMBER_EMAIL = 'katao_invoice.MEMBER_EMAIL';
  38. /** the column name for the MEMBER_ADDRESS1 field */
  39. const MEMBER_ADDRESS1 = 'katao_invoice.MEMBER_ADDRESS1';
  40. /** the column name for the MEMBER_ADDRESS2 field */
  41. const MEMBER_ADDRESS2 = 'katao_invoice.MEMBER_ADDRESS2';
  42. /** the column name for the MEMBER_ZIP field */
  43. const MEMBER_ZIP = 'katao_invoice.MEMBER_ZIP';
  44. /** the column name for the MEMBER_CITY field */
  45. const MEMBER_CITY = 'katao_invoice.MEMBER_CITY';
  46. /** the column name for the KATAO_NAME field */
  47. const KATAO_NAME = 'katao_invoice.KATAO_NAME';
  48. /** the column name for the KATAO_ADDRESS field */
  49. const KATAO_ADDRESS = 'katao_invoice.KATAO_ADDRESS';
  50. /** the column name for the KATAO_SIRET_NUMBER field */
  51. const KATAO_SIRET_NUMBER = 'katao_invoice.KATAO_SIRET_NUMBER';
  52. /** the column name for the KATAO_RCS_NUMBER field */
  53. const KATAO_RCS_NUMBER = 'katao_invoice.KATAO_RCS_NUMBER';
  54. /** the column name for the KATAO_CAPITAL field */
  55. const KATAO_CAPITAL = 'katao_invoice.KATAO_CAPITAL';
  56. /** the column name for the SOL_AMOUNT field */
  57. const SOL_AMOUNT = 'katao_invoice.SOL_AMOUNT';
  58. /** the column name for the CREATED_AT field */
  59. const CREATED_AT = 'katao_invoice.CREATED_AT';
  60. /** the column name for the UPDATED_AT field */
  61. const UPDATED_AT = 'katao_invoice.UPDATED_AT';
  62. /** The PHP to DB Name Mapping */
  63. private static $phpNameMap = null;
  64. /**
  65. * holds an array of fieldnames
  66. *
  67. * first dimension keys are the type constants
  68. * e.g. self::$fieldNames[self::TYPE_PHPNAME][0] = 'Id'
  69. */
  70. private static $fieldNames = array (
  71. BasePeer::TYPE_PHPNAME => array ('Id', 'KataoMemberId', 'KataoPeriodId', 'KataoNodeId', 'KataoCartId', 'Status', 'MemberFirstName', 'MemberLastName', 'MemberEmail', 'MemberAddress1', 'MemberAddress2', 'MemberZip', 'MemberCity', 'KataoName', 'KataoAddress', 'KataoSiretNumber', 'KataoRcsNumber', 'KataoCapital', 'SolAmount', 'CreatedAt', 'UpdatedAt', ),
  72. BasePeer::TYPE_COLNAME => array (KataoInvoicePeer::ID, KataoInvoicePeer::KATAO_MEMBER_ID, KataoInvoicePeer::KATAO_PERIOD_ID, KataoInvoicePeer::KATAO_NODE_ID, KataoInvoicePeer::KATAO_CART_ID, KataoInvoicePeer::STATUS, KataoInvoicePeer::MEMBER_FIRST_NAME, KataoInvoicePeer::MEMBER_LAST_NAME, KataoInvoicePeer::MEMBER_EMAIL, KataoInvoicePeer::MEMBER_ADDRESS1, KataoInvoicePeer::MEMBER_ADDRESS2, KataoInvoicePeer::MEMBER_ZIP, KataoInvoicePeer::MEMBER_CITY, KataoInvoicePeer::KATAO_NAME, KataoInvoicePeer::KATAO_ADDRESS, KataoInvoicePeer::KATAO_SIRET_NUMBER, KataoInvoicePeer::KATAO_RCS_NUMBER, KataoInvoicePeer::KATAO_CAPITAL, KataoInvoicePeer::SOL_AMOUNT, KataoInvoicePeer::CREATED_AT, KataoInvoicePeer::UPDATED_AT, ),
  73. BasePeer::TYPE_FIELDNAME => array ('id', 'katao_member_id', 'katao_period_id', 'katao_node_id', 'katao_cart_id', 'status', 'member_first_name', 'member_last_name', 'member_email', 'member_address1', 'member_address2', 'member_zip', 'member_city', 'katao_name', 'katao_address', 'katao_siret_number', 'katao_rcs_number', 'katao_capital', 'sol_amount', 'created_at', 'updated_at', ),
  74. 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, )
  75. );
  76. /**
  77. * holds an array of keys for quick access to the fieldnames array
  78. *
  79. * first dimension keys are the type constants
  80. * e.g. self::$fieldNames[BasePeer::TYPE_PHPNAME]['Id'] = 0
  81. */
  82. private static $fieldKeys = array (
  83. BasePeer::TYPE_PHPNAME => array ('Id' => 0, 'KataoMemberId' => 1, 'KataoPeriodId' => 2, 'KataoNodeId' => 3, 'KataoCartId' => 4, 'Status' => 5, 'MemberFirstName' => 6, 'MemberLastName' => 7, 'MemberEmail' => 8, 'MemberAddress1' => 9, 'MemberAddress2' => 10, 'MemberZip' => 11, 'MemberCity' => 12, 'KataoName' => 13, 'KataoAddress' => 14, 'KataoSiretNumber' => 15, 'KataoRcsNumber' => 16, 'KataoCapital' => 17, 'SolAmount' => 18, 'CreatedAt' => 19, 'UpdatedAt' => 20, ),
  84. BasePeer::TYPE_COLNAME => array (KataoInvoicePeer::ID => 0, KataoInvoicePeer::KATAO_MEMBER_ID => 1, KataoInvoicePeer::KATAO_PERIOD_ID => 2, KataoInvoicePeer::KATAO_NODE_ID => 3, KataoInvoicePeer::KATAO_CART_ID => 4, KataoInvoicePeer::STATUS => 5, KataoInvoicePeer::MEMBER_FIRST_NAME => 6, KataoInvoicePeer::MEMBER_LAST_NAME => 7, KataoInvoicePeer::MEMBER_EMAIL => 8, KataoInvoicePeer::MEMBER_ADDRESS1 => 9, KataoInvoicePeer::MEMBER_ADDRESS2 => 10, KataoInvoicePeer::MEMBER_ZIP => 11, KataoInvoicePeer::MEMBER_CITY => 12, KataoInvoicePeer::KATAO_NAME => 13, KataoInvoicePeer::KATAO_ADDRESS => 14, KataoInvoicePeer::KATAO_SIRET_NUMBER => 15, KataoInvoicePeer::KATAO_RCS_NUMBER => 16, KataoInvoicePeer::KATAO_CAPITAL => 17, KataoInvoicePeer::SOL_AMOUNT => 18, KataoInvoicePeer::CREATED_AT => 19, KataoInvoicePeer::UPDATED_AT => 20, ),
  85. BasePeer::TYPE_FIELDNAME => array ('id' => 0, 'katao_member_id' => 1, 'katao_period_id' => 2, 'katao_node_id' => 3, 'katao_cart_id' => 4, 'status' => 5, 'member_first_name' => 6, 'member_last_name' => 7, 'member_email' => 8, 'member_address1' => 9, 'member_address2' => 10, 'member_zip' => 11, 'member_city' => 12, 'katao_name' => 13, 'katao_address' => 14, 'katao_siret_number' => 15, 'katao_rcs_number' => 16, 'katao_capital' => 17, 'sol_amount' => 18, 'created_at' => 19, 'updated_at' => 20, ),
  86. 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, )
  87. );
  88. /**
  89. * @return MapBuilder the map builder for this peer
  90. * @throws PropelException Any exceptions caught during processing will be
  91. * rethrown wrapped into a PropelException.
  92. */
  93. public static function getMapBuilder()
  94. {
  95. return BasePeer::getMapBuilder('lib.model.map.KataoInvoiceMapBuilder');
  96. }
  97. /**
  98. * Gets a map (hash) of PHP names to DB column names.
  99. *
  100. * @return array The PHP to DB name map for this peer
  101. * @throws PropelException Any exceptions caught during processing will be
  102. * rethrown wrapped into a PropelException.
  103. * @deprecated Use the getFieldNames() and translateFieldName() methods instead of this.
  104. */
  105. public static function getPhpNameMap()
  106. {
  107. if (self::$phpNameMap === null) {
  108. $map = KataoInvoicePeer::getTableMap();
  109. $columns = $map->getColumns();
  110. $nameMap = array();
  111. foreach ($columns as $column) {
  112. $nameMap[$column->getPhpName()] = $column->getColumnName();
  113. }
  114. self::$phpNameMap = $nameMap;
  115. }
  116. return self::$phpNameMap;
  117. }
  118. /**
  119. * Translates a fieldname to another type
  120. *
  121. * @param string $name field name
  122. * @param string $fromType One of the class type constants TYPE_PHPNAME,
  123. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  124. * @param string $toType One of the class type constants
  125. * @return string translated name of the field.
  126. */
  127. static public function translateFieldName($name, $fromType, $toType)
  128. {
  129. $toNames = self::getFieldNames($toType);
  130. $key = isset(self::$fieldKeys[$fromType][$name]) ? self::$fieldKeys[$fromType][$name] : null;
  131. if ($key === null) {
  132. throw new PropelException("'$name' could not be found in the field names of type '$fromType'. These are: " . print_r(self::$fieldKeys[$fromType], true));
  133. }
  134. return $toNames[$key];
  135. }
  136. /**
  137. * Returns an array of of field names.
  138. *
  139. * @param string $type The type of fieldnames to return:
  140. * One of the class type constants TYPE_PHPNAME,
  141. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  142. * @return array A list of field names
  143. */
  144. static public function getFieldNames($type = BasePeer::TYPE_PHPNAME)
  145. {
  146. if (!array_key_exists($type, self::$fieldNames)) {
  147. 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.');
  148. }
  149. return self::$fieldNames[$type];
  150. }
  151. /**
  152. * Convenience method which changes table.column to alias.column.
  153. *
  154. * Using this method you can maintain SQL abstraction while using column aliases.
  155. * <code>
  156. * $c->addAlias("alias1", TablePeer::TABLE_NAME);
  157. * $c->addJoin(TablePeer::alias("alias1", TablePeer::PRIMARY_KEY_COLUMN), TablePeer::PRIMARY_KEY_COLUMN);
  158. * </code>
  159. * @param string $alias The alias for the current table.
  160. * @param string $column The column name for current table. (i.e. KataoInvoicePeer::COLUMN_NAME).
  161. * @return string
  162. */
  163. public static function alias($alias, $column)
  164. {
  165. return str_replace(KataoInvoicePeer::TABLE_NAME.'.', $alias.'.', $column);
  166. }
  167. /**
  168. * Add all the columns needed to create a new object.
  169. *
  170. * Note: any columns that were marked with lazyLoad="true" in the
  171. * XML schema will not be added to the select list and only loaded
  172. * on demand.
  173. *
  174. * @param criteria object containing the columns to add.
  175. * @throws PropelException Any exceptions caught during processing will be
  176. * rethrown wrapped into a PropelException.
  177. */
  178. public static function addSelectColumns(Criteria $criteria)
  179. {
  180. $criteria->addSelectColumn(KataoInvoicePeer::ID);
  181. $criteria->addSelectColumn(KataoInvoicePeer::KATAO_MEMBER_ID);
  182. $criteria->addSelectColumn(KataoInvoicePeer::KATAO_PERIOD_ID);
  183. $criteria->addSelectColumn(KataoInvoicePeer::KATAO_NODE_ID);
  184. $criteria->addSelectColumn(KataoInvoicePeer::KATAO_CART_ID);
  185. $criteria->addSelectColumn(KataoInvoicePeer::STATUS);
  186. $criteria->addSelectColumn(KataoInvoicePeer::MEMBER_FIRST_NAME);
  187. $criteria->addSelectColumn(KataoInvoicePeer::MEMBER_LAST_NAME);
  188. $criteria->addSelectColumn(KataoInvoicePeer::MEMBER_EMAIL);
  189. $criteria->addSelectColumn(KataoInvoicePeer::MEMBER_ADDRESS1);
  190. $criteria->addSelectColumn(KataoInvoicePeer::MEMBER_ADDRESS2);
  191. $criteria->addSelectColumn(KataoInvoicePeer::MEMBER_ZIP);
  192. $criteria->addSelectColumn(KataoInvoicePeer::MEMBER_CITY);
  193. $criteria->addSelectColumn(KataoInvoicePeer::KATAO_NAME);
  194. $criteria->addSelectColumn(KataoInvoicePeer::KATAO_ADDRESS);
  195. $criteria->addSelectColumn(KataoInvoicePeer::KATAO_SIRET_NUMBER);
  196. $criteria->addSelectColumn(KataoInvoicePeer::KATAO_RCS_NUMBER);
  197. $criteria->addSelectColumn(KataoInvoicePeer::KATAO_CAPITAL);
  198. $criteria->addSelectColumn(KataoInvoicePeer::SOL_AMOUNT);
  199. $criteria->addSelectColumn(KataoInvoicePeer::CREATED_AT);
  200. $criteria->addSelectColumn(KataoInvoicePeer::UPDATED_AT);
  201. }
  202. const COUNT = 'COUNT(katao_invoice.ID)';
  203. const COUNT_DISTINCT = 'COUNT(DISTINCT katao_invoice.ID)';
  204. /**
  205. * Returns the number of rows matching criteria.
  206. *
  207. * @param Criteria $criteria
  208. * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
  209. * @param Connection $con
  210. * @return int Number of matching rows.
  211. */
  212. public static function doCount(Criteria $criteria, $distinct = false, $con = null)
  213. {
  214. // we're going to modify criteria, so copy it first
  215. $criteria = clone $criteria;
  216. // clear out anything that might confuse the ORDER BY clause
  217. $criteria->clearSelectColumns()->clearOrderByColumns();
  218. if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
  219. $criteria->addSelectColumn(KataoInvoicePeer::COUNT_DISTINCT);
  220. } else {
  221. $criteria->addSelectColumn(KataoInvoicePeer::COUNT);
  222. }
  223. // just in case we're grouping: add those columns to the select statement
  224. foreach($criteria->getGroupByColumns() as $column)
  225. {
  226. $criteria->addSelectColumn($column);
  227. }
  228. $rs = KataoInvoicePeer::doSelectRS($criteria, $con);
  229. if ($rs->next()) {
  230. return $rs->getInt(1);
  231. } else {
  232. // no rows returned; we infer that means 0 matches.
  233. return 0;
  234. }
  235. }
  236. /**
  237. * Method to select one object from the DB.
  238. *
  239. * @param Criteria $criteria object used to create the SELECT statement.
  240. * @param Connection $con
  241. * @return KataoInvoice
  242. * @throws PropelException Any exceptions caught during processing will be
  243. * rethrown wrapped into a PropelException.
  244. */
  245. public static function doSelectOne(Criteria $criteria, $con = null)
  246. {
  247. $critcopy = clone $criteria;
  248. $critcopy->setLimit(1);
  249. $objects = KataoInvoicePeer::doSelect($critcopy, $con);
  250. if ($objects) {
  251. return $objects[0];
  252. }
  253. return null;
  254. }
  255. /**
  256. * Method to do selects.
  257. *
  258. * @param Criteria $criteria The Criteria object used to build the SELECT statement.
  259. * @param Connection $con
  260. * @return array Array of selected Objects
  261. * @throws PropelException Any exceptions caught during processing will be
  262. * rethrown wrapped into a PropelException.
  263. */
  264. public static function doSelect(Criteria $criteria, $con = null)
  265. {
  266. return KataoInvoicePeer::populateObjects(KataoInvoicePeer::doSelectRS($criteria, $con));
  267. }
  268. /**
  269. * Prepares the Criteria object and uses the parent doSelect()
  270. * method to get a ResultSet.
  271. *
  272. * Use this method directly if you want to just get the resultset
  273. * (instead of an array of objects).
  274. *
  275. * @param Criteria $criteria The Criteria object used to build the SELECT statement.
  276. * @param Connection $con the connection to use
  277. * @throws PropelException Any exceptions caught during processing will be
  278. * rethrown wrapped into a PropelException.
  279. * @return ResultSet The resultset object with numerically-indexed fields.
  280. * @see BasePeer::doSelect()
  281. */
  282. public static function doSelectRS(Criteria $criteria, $con = null)
  283. {
  284. foreach (sfMixer::getCallables('BaseKataoInvoicePeer:doSelectRS:doSelectRS') as $callable)
  285. {
  286. call_user_func($callable, 'BaseKataoInvoicePeer', $criteria, $con);
  287. }
  288. if ($con === null) {
  289. $con = Propel::getConnection(self::DATABASE_NAME);
  290. }
  291. if (!$criteria->getSelectColumns()) {
  292. $criteria = clone $criteria;
  293. KataoInvoicePeer::addSelectColumns($criteria);
  294. }
  295. // Set the correct dbName
  296. $criteria->setDbName(self::DATABASE_NAME);
  297. // BasePeer returns a Creole ResultSet, set to return
  298. // rows indexed numerically.
  299. return BasePeer::doSelect($criteria, $con);
  300. }
  301. /**
  302. * The returned array will contain objects of the default type or
  303. * objects that inherit from the default.
  304. *
  305. * @throws PropelException Any exceptions caught during processing will be
  306. * rethrown wrapped into a PropelException.
  307. */
  308. public static function populateObjects(ResultSet $rs)
  309. {
  310. $results = array();
  311. // set the class once to avoid overhead in the loop
  312. $cls = KataoInvoicePeer::getOMClass();
  313. $cls = sfPropel::import($cls);
  314. // populate the object(s)
  315. while($rs->next()) {
  316. $obj = new $cls();
  317. $obj->hydrate($rs);
  318. $results[] = $obj;
  319. }
  320. return $results;
  321. }
  322. /**
  323. * Returns the number of rows matching criteria, joining the related KataoMember table
  324. *
  325. * @param Criteria $c
  326. * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
  327. * @param Connection $con
  328. * @return int Number of matching rows.
  329. */
  330. public static function doCountJoinKataoMember(Criteria $criteria, $distinct = false, $con = null)
  331. {
  332. // we're going to modify criteria, so copy it first
  333. $criteria = clone $criteria;
  334. // clear out anything that might confuse the ORDER BY clause
  335. $criteria->clearSelectColumns()->clearOrderByColumns();
  336. if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
  337. $criteria->addSelectColumn(KataoInvoicePeer::COUNT_DISTINCT);
  338. } else {
  339. $criteria->addSelectColumn(KataoInvoicePeer::COUNT);
  340. }
  341. // just in case we're grouping: add those columns to the select statement
  342. foreach($criteria->getGroupByColumns() as $column)
  343. {
  344. $criteria->addSelectColumn($column);
  345. }
  346. $criteria->addJoin(KataoInvoicePeer::KATAO_MEMBER_ID, KataoMemberPeer::ID);
  347. $rs = KataoInvoicePeer::doSelectRS($criteria, $con);
  348. if ($rs->next()) {
  349. return $rs->getInt(1);
  350. } else {
  351. // no rows returned; we infer that means 0 matches.
  352. return 0;
  353. }
  354. }
  355. /**
  356. * Returns the number of rows matching criteria, joining the related KataoPeriod table
  357. *
  358. * @param Criteria $c
  359. * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
  360. * @param Connection $con
  361. * @return int Number of matching rows.
  362. */
  363. public static function doCountJoinKataoPeriod(Criteria $criteria, $distinct = false, $con = null)
  364. {
  365. // we're going to modify criteria, so copy it first
  366. $criteria = clone $criteria;
  367. // clear out anything that might confuse the ORDER BY clause
  368. $criteria->clearSelectColumns()->clearOrderByColumns();
  369. if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
  370. $criteria->addSelectColumn(KataoInvoicePeer::COUNT_DISTINCT);
  371. } else {
  372. $criteria->addSelectColumn(KataoInvoicePeer::COUNT);
  373. }
  374. // just in case we're grouping: add those columns to the select statement
  375. foreach($criteria->getGroupByColumns() as $column)
  376. {
  377. $criteria->addSelectColumn($column);
  378. }
  379. $criteria->addJoin(KataoInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  380. $rs = KataoInvoicePeer::doSelectRS($criteria, $con);
  381. if ($rs->next()) {
  382. return $rs->getInt(1);
  383. } else {
  384. // no rows returned; we infer that means 0 matches.
  385. return 0;
  386. }
  387. }
  388. /**
  389. * Returns the number of rows matching criteria, joining the related KataoNode 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 doCountJoinKataoNode(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(KataoInvoicePeer::COUNT_DISTINCT);
  404. } else {
  405. $criteria->addSelectColumn(KataoInvoicePeer::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(KataoInvoicePeer::KATAO_NODE_ID, KataoNodePeer::ID);
  413. $rs = KataoInvoicePeer::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 KataoCart 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 doCountJoinKataoCart(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(KataoInvoicePeer::COUNT_DISTINCT);
  437. } else {
  438. $criteria->addSelectColumn(KataoInvoicePeer::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(KataoInvoicePeer::KATAO_CART_ID, KataoCartPeer::ID);
  446. $rs = KataoInvoicePeer::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 KataoInvoice objects pre-filled with their KataoMember objects.
  456. *
  457. * @return array Array of KataoInvoice objects.
  458. * @throws PropelException Any exceptions caught during processing will be
  459. * rethrown wrapped into a PropelException.
  460. */
  461. public static function doSelectJoinKataoMember(Criteria $c, $con = null)
  462. {
  463. foreach (sfMixer::getCallables('BaseKataoInvoicePeer:doSelectJoin:doSelectJoin') as $callable)
  464. {
  465. call_user_func($callable, 'BaseKataoInvoicePeer', $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. KataoInvoicePeer::addSelectColumns($c);
  473. $startcol = (KataoInvoicePeer::NUM_COLUMNS - KataoInvoicePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
  474. KataoMemberPeer::addSelectColumns($c);
  475. $c->addJoin(KataoInvoicePeer::KATAO_MEMBER_ID, KataoMemberPeer::ID);
  476. $rs = BasePeer::doSelect($c, $con);
  477. $results = array();
  478. while($rs->next()) {
  479. $omClass = KataoInvoicePeer::getOMClass();
  480. $cls = sfPropel::import($omClass);
  481. $obj1 = new $cls();
  482. $obj1->hydrate($rs);
  483. $omClass = KataoMemberPeer::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->getKataoMember(); //CHECKME
  490. if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
  491. $newObject = false;
  492. // e.g. $author->addBookRelatedByBookId()
  493. $temp_obj2->addKataoInvoice($obj1); //CHECKME
  494. break;
  495. }
  496. }
  497. if ($newObject) {
  498. $obj2->initKataoInvoices();
  499. $obj2->addKataoInvoice($obj1); //CHECKME
  500. }
  501. $results[] = $obj1;
  502. }
  503. return $results;
  504. }
  505. /**
  506. * Selects a collection of KataoInvoice objects pre-filled with their KataoPeriod objects.
  507. *
  508. * @return array Array of KataoInvoice 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('BaseKataoInvoicePeer:doSelectJoin:doSelectJoin') as $callable)
  515. {
  516. call_user_func($callable, 'BaseKataoInvoicePeer', $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. KataoInvoicePeer::addSelectColumns($c);
  524. $startcol = (KataoInvoicePeer::NUM_COLUMNS - KataoInvoicePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
  525. KataoPeriodPeer::addSelectColumns($c);
  526. $c->addJoin(KataoInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  527. $rs = BasePeer::doSelect($c, $con);
  528. $results = array();
  529. while($rs->next()) {
  530. $omClass = KataoInvoicePeer::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->addKataoInvoice($obj1); //CHECKME
  545. break;
  546. }
  547. }
  548. if ($newObject) {
  549. $obj2->initKataoInvoices();
  550. $obj2->addKataoInvoice($obj1); //CHECKME
  551. }
  552. $results[] = $obj1;
  553. }
  554. return $results;
  555. }
  556. /**
  557. * Selects a collection of KataoInvoice objects pre-filled with their KataoNode objects.
  558. *
  559. * @return array Array of KataoInvoice objects.
  560. * @throws PropelException Any exceptions caught during processing will be
  561. * rethrown wrapped into a PropelException.
  562. */
  563. public static function doSelectJoinKataoNode(Criteria $c, $con = null)
  564. {
  565. foreach (sfMixer::getCallables('BaseKataoInvoicePeer:doSelectJoin:doSelectJoin') as $callable)
  566. {
  567. call_user_func($callable, 'BaseKataoInvoicePeer', $c, $con);
  568. }
  569. $c = clone $c;
  570. // Set the correct dbName if it has not been overridden
  571. if ($c->getDbName() == Propel::getDefaultDB()) {
  572. $c->setDbName(self::DATABASE_NAME);
  573. }
  574. KataoInvoicePeer::addSelectColumns($c);
  575. $startcol = (KataoInvoicePeer::NUM_COLUMNS - KataoInvoicePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
  576. KataoNodePeer::addSelectColumns($c);
  577. $c->addJoin(KataoInvoicePeer::KATAO_NODE_ID, KataoNodePeer::ID);
  578. $rs = BasePeer::doSelect($c, $con);
  579. $results = array();
  580. while($rs->next()) {
  581. $omClass = KataoInvoicePeer::getOMClass();
  582. $cls = sfPropel::import($omClass);
  583. $obj1 = new $cls();
  584. $obj1->hydrate($rs);
  585. $omClass = KataoNodePeer::getOMClass();
  586. $cls = sfPropel::import($omClass);
  587. $obj2 = new $cls();
  588. $obj2->hydrate($rs, $startcol);
  589. $newObject = true;
  590. foreach($results as $temp_obj1) {
  591. $temp_obj2 = $temp_obj1->getKataoNode(); //CHECKME
  592. if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
  593. $newObject = false;
  594. // e.g. $author->addBookRelatedByBookId()
  595. $temp_obj2->addKataoInvoice($obj1); //CHECKME
  596. break;
  597. }
  598. }
  599. if ($newObject) {
  600. $obj2->initKataoInvoices();
  601. $obj2->addKataoInvoice($obj1); //CHECKME
  602. }
  603. $results[] = $obj1;
  604. }
  605. return $results;
  606. }
  607. /**
  608. * Selects a collection of KataoInvoice objects pre-filled with their KataoCart objects.
  609. *
  610. * @return array Array of KataoInvoice objects.
  611. * @throws PropelException Any exceptions caught during processing will be
  612. * rethrown wrapped into a PropelException.
  613. */
  614. public static function doSelectJoinKataoCart(Criteria $c, $con = null)
  615. {
  616. foreach (sfMixer::getCallables('BaseKataoInvoicePeer:doSelectJoin:doSelectJoin') as $callable)
  617. {
  618. call_user_func($callable, 'BaseKataoInvoicePeer', $c, $con);
  619. }
  620. $c = clone $c;
  621. // Set the correct dbName if it has not been overridden
  622. if ($c->getDbName() == Propel::getDefaultDB()) {
  623. $c->setDbName(self::DATABASE_NAME);
  624. }
  625. KataoInvoicePeer::addSelectColumns($c);
  626. $startcol = (KataoInvoicePeer::NUM_COLUMNS - KataoInvoicePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
  627. KataoCartPeer::addSelectColumns($c);
  628. $c->addJoin(KataoInvoicePeer::KATAO_CART_ID, KataoCartPeer::ID);
  629. $rs = BasePeer::doSelect($c, $con);
  630. $results = array();
  631. while($rs->next()) {
  632. $omClass = KataoInvoicePeer::getOMClass();
  633. $cls = sfPropel::import($omClass);
  634. $obj1 = new $cls();
  635. $obj1->hydrate($rs);
  636. $omClass = KataoCartPeer::getOMClass();
  637. $cls = sfPropel::import($omClass);
  638. $obj2 = new $cls();
  639. $obj2->hydrate($rs, $startcol);
  640. $newObject = true;
  641. foreach($results as $temp_obj1) {
  642. $temp_obj2 = $temp_obj1->getKataoCart(); //CHECKME
  643. if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
  644. $newObject = false;
  645. // e.g. $author->addBookRelatedByBookId()
  646. $temp_obj2->addKataoInvoice($obj1); //CHECKME
  647. break;
  648. }
  649. }
  650. if ($newObject) {
  651. $obj2->initKataoInvoices();
  652. $obj2->addKataoInvoice($obj1); //CHECKME
  653. }
  654. $results[] = $obj1;
  655. }
  656. return $results;
  657. }
  658. /**
  659. * Returns the number of rows matching criteria, joining all related tables
  660. *
  661. * @param Criteria $c
  662. * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
  663. * @param Connection $con
  664. * @return int Number of matching rows.
  665. */
  666. public static function doCountJoinAll(Criteria $criteria, $distinct = false, $con = null)
  667. {
  668. $criteria = clone $criteria;
  669. // clear out anything that might confuse the ORDER BY clause
  670. $criteria->clearSelectColumns()->clearOrderByColumns();
  671. if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
  672. $criteria->addSelectColumn(KataoInvoicePeer::COUNT_DISTINCT);
  673. } else {
  674. $criteria->addSelectColumn(KataoInvoicePeer::COUNT);
  675. }
  676. // just in case we're grouping: add those columns to the select statement
  677. foreach($criteria->getGroupByColumns() as $column)
  678. {
  679. $criteria->addSelectColumn($column);
  680. }
  681. $criteria->addJoin(KataoInvoicePeer::KATAO_MEMBER_ID, KataoMemberPeer::ID);
  682. $criteria->addJoin(KataoInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  683. $criteria->addJoin(KataoInvoicePeer::KATAO_NODE_ID, KataoNodePeer::ID);
  684. $criteria->addJoin(KataoInvoicePeer::KATAO_CART_ID, KataoCartPeer::ID);
  685. $rs = KataoInvoicePeer::doSelectRS($criteria, $con);
  686. if ($rs->next()) {
  687. return $rs->getInt(1);
  688. } else {
  689. // no rows returned; we infer that means 0 matches.
  690. return 0;
  691. }
  692. }
  693. /**
  694. * Selects a collection of KataoInvoice objects pre-filled with all related objects.
  695. *
  696. * @return array Array of KataoInvoice objects.
  697. * @throws PropelException Any exceptions caught during processing will be
  698. * rethrown wrapped into a PropelException.
  699. */
  700. public static function doSelectJoinAll(Criteria $c, $con = null)
  701. {
  702. foreach (sfMixer::getCallables('BaseKataoInvoicePeer:doSelectJoinAll:doSelectJoinAll') as $callable)
  703. {
  704. call_user_func($callable, 'BaseKataoInvoicePeer', $c, $con);
  705. }
  706. $c = clone $c;
  707. // Set the correct dbName if it has not been overridden
  708. if ($c->getDbName() == Propel::getDefaultDB()) {
  709. $c->setDbName(self::DATABASE_NAME);
  710. }
  711. KataoInvoicePeer::addSelectColumns($c);
  712. $startcol2 = (KataoInvoicePeer::NUM_COLUMNS - KataoInvoicePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
  713. KataoMemberPeer::addSelectColumns($c);
  714. $startcol3 = $startcol2 + KataoMemberPeer::NUM_COLUMNS;
  715. KataoPeriodPeer::addSelectColumns($c);
  716. $startcol4 = $startcol3 + KataoPeriodPeer::NUM_COLUMNS;
  717. KataoNodePeer::addSelectColumns($c);
  718. $startcol5 = $startcol4 + KataoNodePeer::NUM_COLUMNS;
  719. KataoCartPeer::addSelectColumns($c);
  720. $startcol6 = $startcol5 + KataoCartPeer::NUM_COLUMNS;
  721. $c->addJoin(KataoInvoicePeer::KATAO_MEMBER_ID, KataoMemberPeer::ID);
  722. $c->addJoin(KataoInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  723. $c->addJoin(KataoInvoicePeer::KATAO_NODE_ID, KataoNodePeer::ID);
  724. $c->addJoin(KataoInvoicePeer::KATAO_CART_ID, KataoCartPeer::ID);
  725. $rs = BasePeer::doSelect($c, $con);
  726. $results = array();
  727. while($rs->next()) {
  728. $omClass = KataoInvoicePeer::getOMClass();
  729. $cls = sfPropel::import($omClass);
  730. $obj1 = new $cls();
  731. $obj1->hydrate($rs);
  732. // Add objects for joined KataoMember rows
  733. $omClass = KataoMemberPeer::getOMClass();
  734. $cls = sfPropel::import($omClass);
  735. $obj2 = new $cls();
  736. $obj2->hydrate($rs, $startcol2);
  737. $newObject = true;
  738. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  739. $temp_obj1 = $results[$j];
  740. $temp_obj2 = $temp_obj1->getKataoMember(); // CHECKME
  741. if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
  742. $newObject = false;
  743. $temp_obj2->addKataoInvoice($obj1); // CHECKME
  744. break;
  745. }
  746. }
  747. if ($newObject) {
  748. $obj2->initKataoInvoices();
  749. $obj2->addKataoInvoice($obj1);
  750. }
  751. // Add objects for joined KataoPeriod rows
  752. $omClass = KataoPeriodPeer::getOMClass();
  753. $cls = sfPropel::import($omClass);
  754. $obj3 = new $cls();
  755. $obj3->hydrate($rs, $startcol3);
  756. $newObject = true;
  757. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  758. $temp_obj1 = $results[$j];
  759. $temp_obj3 = $temp_obj1->getKataoPeriod(); // CHECKME
  760. if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
  761. $newObject = false;
  762. $temp_obj3->addKataoInvoice($obj1); // CHECKME
  763. break;
  764. }
  765. }
  766. if ($newObject) {
  767. $obj3->initKataoInvoices();
  768. $obj3->addKataoInvoice($obj1);
  769. }
  770. // Add objects for joined KataoNode rows
  771. $omClass = KataoNodePeer::getOMClass();
  772. $cls = sfPropel::import($omClass);
  773. $obj4 = new $cls();
  774. $obj4->hydrate($rs, $startcol4);
  775. $newObject = true;
  776. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  777. $temp_obj1 = $results[$j];
  778. $temp_obj4 = $temp_obj1->getKataoNode(); // CHECKME
  779. if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
  780. $newObject = false;
  781. $temp_obj4->addKataoInvoice($obj1); // CHECKME
  782. break;
  783. }
  784. }
  785. if ($newObject) {
  786. $obj4->initKataoInvoices();
  787. $obj4->addKataoInvoice($obj1);
  788. }
  789. // Add objects for joined KataoCart rows
  790. $omClass = KataoCartPeer::getOMClass();
  791. $cls = sfPropel::import($omClass);
  792. $obj5 = new $cls();
  793. $obj5->hydrate($rs, $startcol5);
  794. $newObject = true;
  795. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  796. $temp_obj1 = $results[$j];
  797. $temp_obj5 = $temp_obj1->getKataoCart(); // CHECKME
  798. if ($temp_obj5->getPrimaryKey() === $obj5->getPrimaryKey()) {
  799. $newObject = false;
  800. $temp_obj5->addKataoInvoice($obj1); // CHECKME
  801. break;
  802. }
  803. }
  804. if ($newObject) {
  805. $obj5->initKataoInvoices();
  806. $obj5->addKataoInvoice($obj1);
  807. }
  808. $results[] = $obj1;
  809. }
  810. return $results;
  811. }
  812. /**
  813. * Returns the number of rows matching criteria, joining the related KataoMember table
  814. *
  815. * @param Criteria $c
  816. * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
  817. * @param Connection $con
  818. * @return int Number of matching rows.
  819. */
  820. public static function doCountJoinAllExceptKataoMember(Criteria $criteria, $distinct = false, $con = null)
  821. {
  822. // we're going to modify criteria, so copy it first
  823. $criteria = clone $criteria;
  824. // clear out anything that might confuse the ORDER BY clause
  825. $criteria->clearSelectColumns()->clearOrderByColumns();
  826. if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
  827. $criteria->addSelectColumn(KataoInvoicePeer::COUNT_DISTINCT);
  828. } else {
  829. $criteria->addSelectColumn(KataoInvoicePeer::COUNT);
  830. }
  831. // just in case we're grouping: add those columns to the select statement
  832. foreach($criteria->getGroupByColumns() as $column)
  833. {
  834. $criteria->addSelectColumn($column);
  835. }
  836. $criteria->addJoin(KataoInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  837. $criteria->addJoin(KataoInvoicePeer::KATAO_NODE_ID, KataoNodePeer::ID);
  838. $criteria->addJoin(KataoInvoicePeer::KATAO_CART_ID, KataoCartPeer::ID);
  839. $rs = KataoInvoicePeer::doSelectRS($criteria, $con);
  840. if ($rs->next()) {
  841. return $rs->getInt(1);
  842. } else {
  843. // no rows returned; we infer that means 0 matches.
  844. return 0;
  845. }
  846. }
  847. /**
  848. * Returns the number of rows matching criteria, joining the related KataoPeriod table
  849. *
  850. * @param Criteria $c
  851. * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
  852. * @param Connection $con
  853. * @return int Number of matching rows.
  854. */
  855. public static function doCountJoinAllExceptKataoPeriod(Criteria $criteria, $distinct = false, $con = null)
  856. {
  857. // we're going to modify criteria, so copy it first
  858. $criteria = clone $criteria;
  859. // clear out anything that might confuse the ORDER BY clause
  860. $criteria->clearSelectColumns()->clearOrderByColumns();
  861. if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
  862. $criteria->addSelectColumn(KataoInvoicePeer::COUNT_DISTINCT);
  863. } else {
  864. $criteria->addSelectColumn(KataoInvoicePeer::COUNT);
  865. }
  866. // just in case we're grouping: add those columns to the select statement
  867. foreach($criteria->getGroupByColumns() as $column)
  868. {
  869. $criteria->addSelectColumn($column);
  870. }
  871. $criteria->addJoin(KataoInvoicePeer::KATAO_MEMBER_ID, KataoMemberPeer::ID);
  872. $criteria->addJoin(KataoInvoicePeer::KATAO_NODE_ID, KataoNodePeer::ID);
  873. $criteria->addJoin(KataoInvoicePeer::KATAO_CART_ID, KataoCartPeer::ID);
  874. $rs = KataoInvoicePeer::doSelectRS($criteria, $con);
  875. if ($rs->next()) {
  876. return $rs->getInt(1);
  877. } else {
  878. // no rows returned; we infer that means 0 matches.
  879. return 0;
  880. }
  881. }
  882. /**
  883. * Returns the number of rows matching criteria, joining the related KataoNode table
  884. *
  885. * @param Criteria $c
  886. * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
  887. * @param Connection $con
  888. * @return int Number of matching rows.
  889. */
  890. public static function doCountJoinAllExceptKataoNode(Criteria $criteria, $distinct = false, $con = null)
  891. {
  892. // we're going to modify criteria, so copy it first
  893. $criteria = clone $criteria;
  894. // clear out anything that might confuse the ORDER BY clause
  895. $criteria->clearSelectColumns()->clearOrderByColumns();
  896. if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
  897. $criteria->addSelectColumn(KataoInvoicePeer::COUNT_DISTINCT);
  898. } else {
  899. $criteria->addSelectColumn(KataoInvoicePeer::COUNT);
  900. }
  901. // just in case we're grouping: add those columns to the select statement
  902. foreach($criteria->getGroupByColumns() as $column)
  903. {
  904. $criteria->addSelectColumn($column);
  905. }
  906. $criteria->addJoin(KataoInvoicePeer::KATAO_MEMBER_ID, KataoMemberPeer::ID);
  907. $criteria->addJoin(KataoInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  908. $criteria->addJoin(KataoInvoicePeer::KATAO_CART_ID, KataoCartPeer::ID);
  909. $rs = KataoInvoicePeer::doSelectRS($criteria, $con);
  910. if ($rs->next()) {
  911. return $rs->getInt(1);
  912. } else {
  913. // no rows returned; we infer that means 0 matches.
  914. return 0;
  915. }
  916. }
  917. /**
  918. * Returns the number of rows matching criteria, joining the related KataoCart table
  919. *
  920. * @param Criteria $c
  921. * @param boolean $distinct Whether to select only distinct columns (You can also set DISTINCT modifier in Criteria).
  922. * @param Connection $con
  923. * @return int Number of matching rows.
  924. */
  925. public static function doCountJoinAllExceptKataoCart(Criteria $criteria, $distinct = false, $con = null)
  926. {
  927. // we're going to modify criteria, so copy it first
  928. $criteria = clone $criteria;
  929. // clear out anything that might confuse the ORDER BY clause
  930. $criteria->clearSelectColumns()->clearOrderByColumns();
  931. if ($distinct || in_array(Criteria::DISTINCT, $criteria->getSelectModifiers())) {
  932. $criteria->addSelectColumn(KataoInvoicePeer::COUNT_DISTINCT);
  933. } else {
  934. $criteria->addSelectColumn(KataoInvoicePeer::COUNT);
  935. }
  936. // just in case we're grouping: add those columns to the select statement
  937. foreach($criteria->getGroupByColumns() as $column)
  938. {
  939. $criteria->addSelectColumn($column);
  940. }
  941. $criteria->addJoin(KataoInvoicePeer::KATAO_MEMBER_ID, KataoMemberPeer::ID);
  942. $criteria->addJoin(KataoInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  943. $criteria->addJoin(KataoInvoicePeer::KATAO_NODE_ID, KataoNodePeer::ID);
  944. $rs = KataoInvoicePeer::doSelectRS($criteria, $con);
  945. if ($rs->next()) {
  946. return $rs->getInt(1);
  947. } else {
  948. // no rows returned; we infer that means 0 matches.
  949. return 0;
  950. }
  951. }
  952. /**
  953. * Selects a collection of KataoInvoice objects pre-filled with all related objects except KataoMember.
  954. *
  955. * @return array Array of KataoInvoice objects.
  956. * @throws PropelException Any exceptions caught during processing will be
  957. * rethrown wrapped into a PropelException.
  958. */
  959. public static function doSelectJoinAllExceptKataoMember(Criteria $c, $con = null)
  960. {
  961. foreach (sfMixer::getCallables('BaseKataoInvoicePeer:doSelectJoinAllExcept:doSelectJoinAllExcept') as $callable)
  962. {
  963. call_user_func($callable, 'BaseKataoInvoicePeer', $c, $con);
  964. }
  965. $c = clone $c;
  966. // Set the correct dbName if it has not been overridden
  967. // $c->getDbName() will return the same object if not set to another value
  968. // so == check is okay and faster
  969. if ($c->getDbName() == Propel::getDefaultDB()) {
  970. $c->setDbName(self::DATABASE_NAME);
  971. }
  972. KataoInvoicePeer::addSelectColumns($c);
  973. $startcol2 = (KataoInvoicePeer::NUM_COLUMNS - KataoInvoicePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
  974. KataoPeriodPeer::addSelectColumns($c);
  975. $startcol3 = $startcol2 + KataoPeriodPeer::NUM_COLUMNS;
  976. KataoNodePeer::addSelectColumns($c);
  977. $startcol4 = $startcol3 + KataoNodePeer::NUM_COLUMNS;
  978. KataoCartPeer::addSelectColumns($c);
  979. $startcol5 = $startcol4 + KataoCartPeer::NUM_COLUMNS;
  980. $c->addJoin(KataoInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  981. $c->addJoin(KataoInvoicePeer::KATAO_NODE_ID, KataoNodePeer::ID);
  982. $c->addJoin(KataoInvoicePeer::KATAO_CART_ID, KataoCartPeer::ID);
  983. $rs = BasePeer::doSelect($c, $con);
  984. $results = array();
  985. while($rs->next()) {
  986. $omClass = KataoInvoicePeer::getOMClass();
  987. $cls = sfPropel::import($omClass);
  988. $obj1 = new $cls();
  989. $obj1->hydrate($rs);
  990. $omClass = KataoPeriodPeer::getOMClass();
  991. $cls = sfPropel::import($omClass);
  992. $obj2 = new $cls();
  993. $obj2->hydrate($rs, $startcol2);
  994. $newObject = true;
  995. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  996. $temp_obj1 = $results[$j];
  997. $temp_obj2 = $temp_obj1->getKataoPeriod(); //CHECKME
  998. if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
  999. $newObject = false;
  1000. $temp_obj2->addKataoInvoice($obj1);
  1001. break;
  1002. }
  1003. }
  1004. if ($newObject) {
  1005. $obj2->initKataoInvoices();
  1006. $obj2->addKataoInvoice($obj1);
  1007. }
  1008. $omClass = KataoNodePeer::getOMClass();
  1009. $cls = sfPropel::import($omClass);
  1010. $obj3 = new $cls();
  1011. $obj3->hydrate($rs, $startcol3);
  1012. $newObject = true;
  1013. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  1014. $temp_obj1 = $results[$j];
  1015. $temp_obj3 = $temp_obj1->getKataoNode(); //CHECKME
  1016. if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
  1017. $newObject = false;
  1018. $temp_obj3->addKataoInvoice($obj1);
  1019. break;
  1020. }
  1021. }
  1022. if ($newObject) {
  1023. $obj3->initKataoInvoices();
  1024. $obj3->addKataoInvoice($obj1);
  1025. }
  1026. $omClass = KataoCartPeer::getOMClass();
  1027. $cls = sfPropel::import($omClass);
  1028. $obj4 = new $cls();
  1029. $obj4->hydrate($rs, $startcol4);
  1030. $newObject = true;
  1031. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  1032. $temp_obj1 = $results[$j];
  1033. $temp_obj4 = $temp_obj1->getKataoCart(); //CHECKME
  1034. if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
  1035. $newObject = false;
  1036. $temp_obj4->addKataoInvoice($obj1);
  1037. break;
  1038. }
  1039. }
  1040. if ($newObject) {
  1041. $obj4->initKataoInvoices();
  1042. $obj4->addKataoInvoice($obj1);
  1043. }
  1044. $results[] = $obj1;
  1045. }
  1046. return $results;
  1047. }
  1048. /**
  1049. * Selects a collection of KataoInvoice objects pre-filled with all related objects except KataoPeriod.
  1050. *
  1051. * @return array Array of KataoInvoice objects.
  1052. * @throws PropelException Any exceptions caught during processing will be
  1053. * rethrown wrapped into a PropelException.
  1054. */
  1055. public static function doSelectJoinAllExceptKataoPeriod(Criteria $c, $con = null)
  1056. {
  1057. foreach (sfMixer::getCallables('BaseKataoInvoicePeer:doSelectJoinAllExcept:doSelectJoinAllExcept') as $callable)
  1058. {
  1059. call_user_func($callable, 'BaseKataoInvoicePeer', $c, $con);
  1060. }
  1061. $c = clone $c;
  1062. // Set the correct dbName if it has not been overridden
  1063. // $c->getDbName() will return the same object if not set to another value
  1064. // so == check is okay and faster
  1065. if ($c->getDbName() == Propel::getDefaultDB()) {
  1066. $c->setDbName(self::DATABASE_NAME);
  1067. }
  1068. KataoInvoicePeer::addSelectColumns($c);
  1069. $startcol2 = (KataoInvoicePeer::NUM_COLUMNS - KataoInvoicePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
  1070. KataoMemberPeer::addSelectColumns($c);
  1071. $startcol3 = $startcol2 + KataoMemberPeer::NUM_COLUMNS;
  1072. KataoNodePeer::addSelectColumns($c);
  1073. $startcol4 = $startcol3 + KataoNodePeer::NUM_COLUMNS;
  1074. KataoCartPeer::addSelectColumns($c);
  1075. $startcol5 = $startcol4 + KataoCartPeer::NUM_COLUMNS;
  1076. $c->addJoin(KataoInvoicePeer::KATAO_MEMBER_ID, KataoMemberPeer::ID);
  1077. $c->addJoin(KataoInvoicePeer::KATAO_NODE_ID, KataoNodePeer::ID);
  1078. $c->addJoin(KataoInvoicePeer::KATAO_CART_ID, KataoCartPeer::ID);
  1079. $rs = BasePeer::doSelect($c, $con);
  1080. $results = array();
  1081. while($rs->next()) {
  1082. $omClass = KataoInvoicePeer::getOMClass();
  1083. $cls = sfPropel::import($omClass);
  1084. $obj1 = new $cls();
  1085. $obj1->hydrate($rs);
  1086. $omClass = KataoMemberPeer::getOMClass();
  1087. $cls = sfPropel::import($omClass);
  1088. $obj2 = new $cls();
  1089. $obj2->hydrate($rs, $startcol2);
  1090. $newObject = true;
  1091. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  1092. $temp_obj1 = $results[$j];
  1093. $temp_obj2 = $temp_obj1->getKataoMember(); //CHECKME
  1094. if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
  1095. $newObject = false;
  1096. $temp_obj2->addKataoInvoice($obj1);
  1097. break;
  1098. }
  1099. }
  1100. if ($newObject) {
  1101. $obj2->initKataoInvoices();
  1102. $obj2->addKataoInvoice($obj1);
  1103. }
  1104. $omClass = KataoNodePeer::getOMClass();
  1105. $cls = sfPropel::import($omClass);
  1106. $obj3 = new $cls();
  1107. $obj3->hydrate($rs, $startcol3);
  1108. $newObject = true;
  1109. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  1110. $temp_obj1 = $results[$j];
  1111. $temp_obj3 = $temp_obj1->getKataoNode(); //CHECKME
  1112. if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
  1113. $newObject = false;
  1114. $temp_obj3->addKataoInvoice($obj1);
  1115. break;
  1116. }
  1117. }
  1118. if ($newObject) {
  1119. $obj3->initKataoInvoices();
  1120. $obj3->addKataoInvoice($obj1);
  1121. }
  1122. $omClass = KataoCartPeer::getOMClass();
  1123. $cls = sfPropel::import($omClass);
  1124. $obj4 = new $cls();
  1125. $obj4->hydrate($rs, $startcol4);
  1126. $newObject = true;
  1127. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  1128. $temp_obj1 = $results[$j];
  1129. $temp_obj4 = $temp_obj1->getKataoCart(); //CHECKME
  1130. if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
  1131. $newObject = false;
  1132. $temp_obj4->addKataoInvoice($obj1);
  1133. break;
  1134. }
  1135. }
  1136. if ($newObject) {
  1137. $obj4->initKataoInvoices();
  1138. $obj4->addKataoInvoice($obj1);
  1139. }
  1140. $results[] = $obj1;
  1141. }
  1142. return $results;
  1143. }
  1144. /**
  1145. * Selects a collection of KataoInvoice objects pre-filled with all related objects except KataoNode.
  1146. *
  1147. * @return array Array of KataoInvoice objects.
  1148. * @throws PropelException Any exceptions caught during processing will be
  1149. * rethrown wrapped into a PropelException.
  1150. */
  1151. public static function doSelectJoinAllExceptKataoNode(Criteria $c, $con = null)
  1152. {
  1153. foreach (sfMixer::getCallables('BaseKataoInvoicePeer:doSelectJoinAllExcept:doSelectJoinAllExcept') as $callable)
  1154. {
  1155. call_user_func($callable, 'BaseKataoInvoicePeer', $c, $con);
  1156. }
  1157. $c = clone $c;
  1158. // Set the correct dbName if it has not been overridden
  1159. // $c->getDbName() will return the same object if not set to another value
  1160. // so == check is okay and faster
  1161. if ($c->getDbName() == Propel::getDefaultDB()) {
  1162. $c->setDbName(self::DATABASE_NAME);
  1163. }
  1164. KataoInvoicePeer::addSelectColumns($c);
  1165. $startcol2 = (KataoInvoicePeer::NUM_COLUMNS - KataoInvoicePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
  1166. KataoMemberPeer::addSelectColumns($c);
  1167. $startcol3 = $startcol2 + KataoMemberPeer::NUM_COLUMNS;
  1168. KataoPeriodPeer::addSelectColumns($c);
  1169. $startcol4 = $startcol3 + KataoPeriodPeer::NUM_COLUMNS;
  1170. KataoCartPeer::addSelectColumns($c);
  1171. $startcol5 = $startcol4 + KataoCartPeer::NUM_COLUMNS;
  1172. $c->addJoin(KataoInvoicePeer::KATAO_MEMBER_ID, KataoMemberPeer::ID);
  1173. $c->addJoin(KataoInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  1174. $c->addJoin(KataoInvoicePeer::KATAO_CART_ID, KataoCartPeer::ID);
  1175. $rs = BasePeer::doSelect($c, $con);
  1176. $results = array();
  1177. while($rs->next()) {
  1178. $omClass = KataoInvoicePeer::getOMClass();
  1179. $cls = sfPropel::import($omClass);
  1180. $obj1 = new $cls();
  1181. $obj1->hydrate($rs);
  1182. $omClass = KataoMemberPeer::getOMClass();
  1183. $cls = sfPropel::import($omClass);
  1184. $obj2 = new $cls();
  1185. $obj2->hydrate($rs, $startcol2);
  1186. $newObject = true;
  1187. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  1188. $temp_obj1 = $results[$j];
  1189. $temp_obj2 = $temp_obj1->getKataoMember(); //CHECKME
  1190. if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
  1191. $newObject = false;
  1192. $temp_obj2->addKataoInvoice($obj1);
  1193. break;
  1194. }
  1195. }
  1196. if ($newObject) {
  1197. $obj2->initKataoInvoices();
  1198. $obj2->addKataoInvoice($obj1);
  1199. }
  1200. $omClass = KataoPeriodPeer::getOMClass();
  1201. $cls = sfPropel::import($omClass);
  1202. $obj3 = new $cls();
  1203. $obj3->hydrate($rs, $startcol3);
  1204. $newObject = true;
  1205. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  1206. $temp_obj1 = $results[$j];
  1207. $temp_obj3 = $temp_obj1->getKataoPeriod(); //CHECKME
  1208. if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
  1209. $newObject = false;
  1210. $temp_obj3->addKataoInvoice($obj1);
  1211. break;
  1212. }
  1213. }
  1214. if ($newObject) {
  1215. $obj3->initKataoInvoices();
  1216. $obj3->addKataoInvoice($obj1);
  1217. }
  1218. $omClass = KataoCartPeer::getOMClass();
  1219. $cls = sfPropel::import($omClass);
  1220. $obj4 = new $cls();
  1221. $obj4->hydrate($rs, $startcol4);
  1222. $newObject = true;
  1223. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  1224. $temp_obj1 = $results[$j];
  1225. $temp_obj4 = $temp_obj1->getKataoCart(); //CHECKME
  1226. if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
  1227. $newObject = false;
  1228. $temp_obj4->addKataoInvoice($obj1);
  1229. break;
  1230. }
  1231. }
  1232. if ($newObject) {
  1233. $obj4->initKataoInvoices();
  1234. $obj4->addKataoInvoice($obj1);
  1235. }
  1236. $results[] = $obj1;
  1237. }
  1238. return $results;
  1239. }
  1240. /**
  1241. * Selects a collection of KataoInvoice objects pre-filled with all related objects except KataoCart.
  1242. *
  1243. * @return array Array of KataoInvoice objects.
  1244. * @throws PropelException Any exceptions caught during processing will be
  1245. * rethrown wrapped into a PropelException.
  1246. */
  1247. public static function doSelectJoinAllExceptKataoCart(Criteria $c, $con = null)
  1248. {
  1249. foreach (sfMixer::getCallables('BaseKataoInvoicePeer:doSelectJoinAllExcept:doSelectJoinAllExcept') as $callable)
  1250. {
  1251. call_user_func($callable, 'BaseKataoInvoicePeer', $c, $con);
  1252. }
  1253. $c = clone $c;
  1254. // Set the correct dbName if it has not been overridden
  1255. // $c->getDbName() will return the same object if not set to another value
  1256. // so == check is okay and faster
  1257. if ($c->getDbName() == Propel::getDefaultDB()) {
  1258. $c->setDbName(self::DATABASE_NAME);
  1259. }
  1260. KataoInvoicePeer::addSelectColumns($c);
  1261. $startcol2 = (KataoInvoicePeer::NUM_COLUMNS - KataoInvoicePeer::NUM_LAZY_LOAD_COLUMNS) + 1;
  1262. KataoMemberPeer::addSelectColumns($c);
  1263. $startcol3 = $startcol2 + KataoMemberPeer::NUM_COLUMNS;
  1264. KataoPeriodPeer::addSelectColumns($c);
  1265. $startcol4 = $startcol3 + KataoPeriodPeer::NUM_COLUMNS;
  1266. KataoNodePeer::addSelectColumns($c);
  1267. $startcol5 = $startcol4 + KataoNodePeer::NUM_COLUMNS;
  1268. $c->addJoin(KataoInvoicePeer::KATAO_MEMBER_ID, KataoMemberPeer::ID);
  1269. $c->addJoin(KataoInvoicePeer::KATAO_PERIOD_ID, KataoPeriodPeer::ID);
  1270. $c->addJoin(KataoInvoicePeer::KATAO_NODE_ID, KataoNodePeer::ID);
  1271. $rs = BasePeer::doSelect($c, $con);
  1272. $results = array();
  1273. while($rs->next()) {
  1274. $omClass = KataoInvoicePeer::getOMClass();
  1275. $cls = sfPropel::import($omClass);
  1276. $obj1 = new $cls();
  1277. $obj1->hydrate($rs);
  1278. $omClass = KataoMemberPeer::getOMClass();
  1279. $cls = sfPropel::import($omClass);
  1280. $obj2 = new $cls();
  1281. $obj2->hydrate($rs, $startcol2);
  1282. $newObject = true;
  1283. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  1284. $temp_obj1 = $results[$j];
  1285. $temp_obj2 = $temp_obj1->getKataoMember(); //CHECKME
  1286. if ($temp_obj2->getPrimaryKey() === $obj2->getPrimaryKey()) {
  1287. $newObject = false;
  1288. $temp_obj2->addKataoInvoice($obj1);
  1289. break;
  1290. }
  1291. }
  1292. if ($newObject) {
  1293. $obj2->initKataoInvoices();
  1294. $obj2->addKataoInvoice($obj1);
  1295. }
  1296. $omClass = KataoPeriodPeer::getOMClass();
  1297. $cls = sfPropel::import($omClass);
  1298. $obj3 = new $cls();
  1299. $obj3->hydrate($rs, $startcol3);
  1300. $newObject = true;
  1301. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  1302. $temp_obj1 = $results[$j];
  1303. $temp_obj3 = $temp_obj1->getKataoPeriod(); //CHECKME
  1304. if ($temp_obj3->getPrimaryKey() === $obj3->getPrimaryKey()) {
  1305. $newObject = false;
  1306. $temp_obj3->addKataoInvoice($obj1);
  1307. break;
  1308. }
  1309. }
  1310. if ($newObject) {
  1311. $obj3->initKataoInvoices();
  1312. $obj3->addKataoInvoice($obj1);
  1313. }
  1314. $omClass = KataoNodePeer::getOMClass();
  1315. $cls = sfPropel::import($omClass);
  1316. $obj4 = new $cls();
  1317. $obj4->hydrate($rs, $startcol4);
  1318. $newObject = true;
  1319. for ($j=0, $resCount=count($results); $j < $resCount; $j++) {
  1320. $temp_obj1 = $results[$j];
  1321. $temp_obj4 = $temp_obj1->getKataoNode(); //CHECKME
  1322. if ($temp_obj4->getPrimaryKey() === $obj4->getPrimaryKey()) {
  1323. $newObject = false;
  1324. $temp_obj4->addKataoInvoice($obj1);
  1325. break;
  1326. }
  1327. }
  1328. if ($newObject) {
  1329. $obj4->initKataoInvoices();
  1330. $obj4->addKataoInvoice($obj1);
  1331. }
  1332. $results[] = $obj1;
  1333. }
  1334. return $results;
  1335. }
  1336. static public function getUniqueColumnNames()
  1337. {
  1338. return array();
  1339. }
  1340. /**
  1341. * Returns the TableMap related to this peer.
  1342. * This method is not needed for general use but a specific application could have a need.
  1343. * @return TableMap
  1344. * @throws PropelException Any exceptions caught during processing will be
  1345. * rethrown wrapped into a PropelException.
  1346. */
  1347. public static function getTableMap()
  1348. {
  1349. return Propel::getDatabaseMap(self::DATABASE_NAME)->getTable(self::TABLE_NAME);
  1350. }
  1351. /**
  1352. * The class that the Peer will make instances of.
  1353. *
  1354. * This uses a dot-path notation which is tranalted into a path
  1355. * relative to a location on the PHP include_path.
  1356. * (e.g. path.to.MyClass -> 'path/to/MyClass.php')
  1357. *
  1358. * @return string path.to.ClassName
  1359. */
  1360. public static function getOMClass()
  1361. {
  1362. return KataoInvoicePeer::CLASS_DEFAULT;
  1363. }
  1364. /**
  1365. * Method perform an INSERT on the database, given a KataoInvoice or Criteria object.
  1366. *
  1367. * @param mixed $values Criteria or KataoInvoice object containing data that is used to create the INSERT statement.
  1368. * @param Connection $con the connection to use
  1369. * @return mixed The new primary key.
  1370. * @throws PropelException Any exceptions caught during processing will be
  1371. * rethrown wrapped into a PropelException.
  1372. */
  1373. public static function doInsert($values, $con = null)
  1374. {
  1375. foreach (sfMixer::getCallables('BaseKataoInvoicePeer:doInsert:pre') as $callable)
  1376. {
  1377. $ret = call_user_func($callable, 'BaseKataoInvoicePeer', $values, $con);
  1378. if (false !== $ret)
  1379. {
  1380. return $ret;
  1381. }
  1382. }
  1383. if ($con === null) {
  1384. $con = Propel::getConnection(self::DATABASE_NAME);
  1385. }
  1386. if ($values instanceof Criteria) {
  1387. $criteria = clone $values; // rename for clarity
  1388. } else {
  1389. $criteria = $values->buildCriteria(); // build Criteria from KataoInvoice object
  1390. }
  1391. $criteria->remove(KataoInvoicePeer::ID); // remove pkey col since this table uses auto-increment
  1392. // Set the correct dbName
  1393. $criteria->setDbName(self::DATABASE_NAME);
  1394. try {
  1395. // use transaction because $criteria could contain info
  1396. // for more than one table (I guess, conceivably)
  1397. $con->begin();
  1398. $pk = BasePeer::doInsert($criteria, $con);
  1399. $con->commit();
  1400. } catch(PropelException $e) {
  1401. $con->rollback();
  1402. throw $e;
  1403. }
  1404. foreach (sfMixer::getCallables('BaseKataoInvoicePeer:doInsert:post') as $callable)
  1405. {
  1406. call_user_func($callable, 'BaseKataoInvoicePeer', $values, $con, $pk);
  1407. }
  1408. return $pk;
  1409. }
  1410. /**
  1411. * Method perform an UPDATE on the database, given a KataoInvoice or Criteria object.
  1412. *
  1413. * @param mixed $values Criteria or KataoInvoice object containing data that is used to create the UPDATE statement.
  1414. * @param Connection $con The connection to use (specify Connection object to exert more control over transactions).
  1415. * @return int The number of affected rows (if supported by underlying database driver).
  1416. * @throws PropelException Any exceptions caught during processing will be
  1417. * rethrown wrapped into a PropelException.
  1418. */
  1419. public static function doUpdate($values, $con = null)
  1420. {
  1421. foreach (sfMixer::getCallables('BaseKataoInvoicePeer:doUpdate:pre') as $callable)
  1422. {
  1423. $ret = call_user_func($callable, 'BaseKataoInvoicePeer', $values, $con);
  1424. if (false !== $ret)
  1425. {
  1426. return $ret;
  1427. }
  1428. }
  1429. if ($con === null) {
  1430. $con = Propel::getConnection(self::DATABASE_NAME);
  1431. }
  1432. $selectCriteria = new Criteria(self::DATABASE_NAME);
  1433. if ($values instanceof Criteria) {
  1434. $criteria = clone $values; // rename for clarity
  1435. $comparison = $criteria->getComparison(KataoInvoicePeer::ID);
  1436. $selectCriteria->add(KataoInvoicePeer::ID, $criteria->remove(KataoInvoicePeer::ID), $comparison);
  1437. } else { // $values is KataoInvoice object
  1438. $criteria = $values->buildCriteria(); // gets full criteria
  1439. $selectCriteria = $values->buildPkeyCriteria(); // gets criteria w/ primary key(s)
  1440. }
  1441. // set the correct dbName
  1442. $criteria->setDbName(self::DATABASE_NAME);
  1443. $ret = BasePeer::doUpdate($selectCriteria, $criteria, $con);
  1444. foreach (sfMixer::getCallables('BaseKataoInvoicePeer:doUpdate:post') as $callable)
  1445. {
  1446. call_user_func($callable, 'BaseKataoInvoicePeer', $values, $con, $ret);
  1447. }
  1448. return $ret;
  1449. }
  1450. /**
  1451. * Method to DELETE all rows from the katao_invoice table.
  1452. *
  1453. * @return int The number of affected rows (if supported by underlying database driver).
  1454. */
  1455. public static function doDeleteAll($con = null)
  1456. {
  1457. if ($con === null) {
  1458. $con = Propel::getConnection(self::DATABASE_NAME);
  1459. }
  1460. $affectedRows = 0; // initialize var to track total num of affected rows
  1461. try {
  1462. // use transaction because $criteria could contain info
  1463. // for more than one table or we could emulating ON DELETE CASCADE, etc.
  1464. $con->begin();
  1465. $affectedRows += BasePeer::doDeleteAll(KataoInvoicePeer::TABLE_NAME, $con);
  1466. $con->commit();
  1467. return $affectedRows;
  1468. } catch (PropelException $e) {
  1469. $con->rollback();
  1470. throw $e;
  1471. }
  1472. }
  1473. /**
  1474. * Method perform a DELETE on the database, given a KataoInvoice or Criteria object OR a primary key value.
  1475. *
  1476. * @param mixed $values Criteria or KataoInvoice object or primary key or array of primary keys
  1477. * which is used to create the DELETE statement
  1478. * @param Connection $con the connection to use
  1479. * @return int The number of affected rows (if supported by underlying database driver). This includes CASCADE-related rows
  1480. * if supported by native driver or if emulated using Propel.
  1481. * @throws PropelException Any exceptions caught during processing will be
  1482. * rethrown wrapped into a PropelException.
  1483. */
  1484. public static function doDelete($values, $con = null)
  1485. {
  1486. if ($con === null) {
  1487. $con = Propel::getConnection(KataoInvoicePeer::DATABASE_NAME);
  1488. }
  1489. if ($values instanceof Criteria) {
  1490. $criteria = clone $values; // rename for clarity
  1491. } elseif ($values instanceof KataoInvoice) {
  1492. $criteria = $values->buildPkeyCriteria();
  1493. } else {
  1494. // it must be the primary key
  1495. $criteria = new Criteria(self::DATABASE_NAME);
  1496. $criteria->add(KataoInvoicePeer::ID, (array) $values, Criteria::IN);
  1497. }
  1498. // Set the correct dbName
  1499. $criteria->setDbName(self::DATABASE_NAME);
  1500. $affectedRows = 0; // initialize var to track total num of affected rows
  1501. try {
  1502. // use transaction because $criteria could contain info
  1503. // for more than one table or we could emulating ON DELETE CASCADE, etc.
  1504. $con->begin();
  1505. $affectedRows += BasePeer::doDelete($criteria, $con);
  1506. $con->commit();
  1507. return $affectedRows;
  1508. } catch (PropelException $e) {
  1509. $con->rollback();
  1510. throw $e;
  1511. }
  1512. }
  1513. /**
  1514. * Validates all modified columns of given KataoInvoice object.
  1515. * If parameter $columns is either a single column name or an array of column names
  1516. * than only those columns are validated.
  1517. *
  1518. * NOTICE: This does not apply to primary or foreign keys for now.
  1519. *
  1520. * @param KataoInvoice $obj The object to validate.
  1521. * @param mixed $cols Column name or array of column names.
  1522. *
  1523. * @return mixed TRUE if all columns are valid or the error message of the first invalid column.
  1524. */
  1525. public static function doValidate(KataoInvoice $obj, $cols = null)
  1526. {
  1527. $columns = array();
  1528. if ($cols) {
  1529. $dbMap = Propel::getDatabaseMap(KataoInvoicePeer::DATABASE_NAME);
  1530. $tableMap = $dbMap->getTable(KataoInvoicePeer::TABLE_NAME);
  1531. if (! is_array($cols)) {
  1532. $cols = array($cols);
  1533. }
  1534. foreach($cols as $colName) {
  1535. if ($tableMap->containsColumn($colName)) {
  1536. $get = 'get' . $tableMap->getColumn($colName)->getPhpName();
  1537. $columns[$colName] = $obj->$get();
  1538. }
  1539. }
  1540. } else {
  1541. }
  1542. $res = BasePeer::doValidate(KataoInvoicePeer::DATABASE_NAME, KataoInvoicePeer::TABLE_NAME, $columns);
  1543. if ($res !== true) {
  1544. $request = sfContext::getInstance()->getRequest();
  1545. foreach ($res as $failed) {
  1546. $col = KataoInvoicePeer::translateFieldname($failed->getColumn(), BasePeer::TYPE_COLNAME, BasePeer::TYPE_PHPNAME);
  1547. $request->setError($col, $failed->getMessage());
  1548. }
  1549. }
  1550. return $res;
  1551. }
  1552. /**
  1553. * Retrieve a single object by pkey.
  1554. *
  1555. * @param mixed $pk the primary key.
  1556. * @param Connection $con the connection to use
  1557. * @return KataoInvoice
  1558. */
  1559. public static function retrieveByPK($pk, $con = null)
  1560. {
  1561. if ($con === null) {
  1562. $con = Propel::getConnection(self::DATABASE_NAME);
  1563. }
  1564. $criteria = new Criteria(KataoInvoicePeer::DATABASE_NAME);
  1565. $criteria->add(KataoInvoicePeer::ID, $pk);
  1566. $v = KataoInvoicePeer::doSelect($criteria, $con);
  1567. return !empty($v) > 0 ? $v[0] : null;
  1568. }
  1569. /**
  1570. * Retrieve multiple objects by pkey.
  1571. *
  1572. * @param array $pks List of primary keys
  1573. * @param Connection $con the connection to use
  1574. * @throws PropelException Any exceptions caught during processing will be
  1575. * rethrown wrapped into a PropelException.
  1576. */
  1577. public static function retrieveByPKs($pks, $con = null)
  1578. {
  1579. if ($con === null) {
  1580. $con = Propel::getConnection(self::DATABASE_NAME);
  1581. }
  1582. $objs = null;
  1583. if (empty($pks)) {
  1584. $objs = array();
  1585. } else {
  1586. $criteria = new Criteria();
  1587. $criteria->add(KataoInvoicePeer::ID, $pks, Criteria::IN);
  1588. $objs = KataoInvoicePeer::doSelect($criteria, $con);
  1589. }
  1590. return $objs;
  1591. }
  1592. } // BaseKataoInvoicePeer
  1593. // static code to register the map builder for this Peer with the main Propel class
  1594. if (Propel::isInit()) {
  1595. // the MapBuilder classes register themselves with Propel during initialization
  1596. // so we need to load them here.
  1597. try {
  1598. BaseKataoInvoicePeer::getMapBuilder();
  1599. } catch (Exception $e) {
  1600. Propel::log('Could not initialize Peer: ' . $e->getMessage(), Propel::LOG_ERR);
  1601. }
  1602. } else {
  1603. // even if Propel is not yet initialized, the map builder class can be registered
  1604. // now and then it will be loaded when Propel initializes.
  1605. Propel::registerMapBuilder('lib.model.map.KataoInvoiceMapBuilder');
  1606. }