BaseKataoNodeSupplierPeer.php 48 KB

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