BaseKataoInvoiceProductPeer.php 64 KB

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