BaseKataoNode.php 86 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364656667686970717273747576777879808182838485868788899091929394959697989910010110210310410510610710810911011111211311411511611711811912012112212312412512612712812913013113213313413513613713813914014114214314414514614714814915015115215315415515615715815916016116216316416516616716816917017117217317417517617717817918018118218318418518618718818919019119219319419519619719819920020120220320420520620720820921021121221321421521621721821922022122222322422522622722822923023123223323423523623723823924024124224324424524624724824925025125225325425525625725825926026126226326426526626726826927027127227327427527627727827928028128228328428528628728828929029129229329429529629729829930030130230330430530630730830931031131231331431531631731831932032132232332432532632732832933033133233333433533633733833934034134234334434534634734834935035135235335435535635735835936036136236336436536636736836937037137237337437537637737837938038138238338438538638738838939039139239339439539639739839940040140240340440540640740840941041141241341441541641741841942042142242342442542642742842943043143243343443543643743843944044144244344444544644744844945045145245345445545645745845946046146246346446546646746846947047147247347447547647747847948048148248348448548648748848949049149249349449549649749849950050150250350450550650750850951051151251351451551651751851952052152252352452552652752852953053153253353453553653753853954054154254354454554654754854955055155255355455555655755855956056156256356456556656756856957057157257357457557657757857958058158258358458558658758858959059159259359459559659759859960060160260360460560660760860961061161261361461561661761861962062162262362462562662762862963063163263363463563663763863964064164264364464564664764864965065165265365465565665765865966066166266366466566666766866967067167267367467567667767867968068168268368468568668768868969069169269369469569669769869970070170270370470570670770870971071171271371471571671771871972072172272372472572672772872973073173273373473573673773873974074174274374474574674774874975075175275375475575675775875976076176276376476576676776876977077177277377477577677777877978078178278378478578678778878979079179279379479579679779879980080180280380480580680780880981081181281381481581681781881982082182282382482582682782882983083183283383483583683783883984084184284384484584684784884985085185285385485585685785885986086186286386486586686786886987087187287387487587687787887988088188288388488588688788888989089189289389489589689789889990090190290390490590690790890991091191291391491591691791891992092192292392492592692792892993093193293393493593693793893994094194294394494594694794894995095195295395495595695795895996096196296396496596696796896997097197297397497597697797897998098198298398498598698798898999099199299399499599699799899910001001100210031004100510061007100810091010101110121013101410151016101710181019102010211022102310241025102610271028102910301031103210331034103510361037103810391040104110421043104410451046104710481049105010511052105310541055105610571058105910601061106210631064106510661067106810691070107110721073107410751076107710781079108010811082108310841085108610871088108910901091109210931094109510961097109810991100110111021103110411051106110711081109111011111112111311141115111611171118111911201121112211231124112511261127112811291130113111321133113411351136113711381139114011411142114311441145114611471148114911501151115211531154115511561157115811591160116111621163116411651166116711681169117011711172117311741175117611771178117911801181118211831184118511861187118811891190119111921193119411951196119711981199120012011202120312041205120612071208120912101211121212131214121512161217121812191220122112221223122412251226122712281229123012311232123312341235123612371238123912401241124212431244124512461247124812491250125112521253125412551256125712581259126012611262126312641265126612671268126912701271127212731274127512761277127812791280128112821283128412851286128712881289129012911292129312941295129612971298129913001301130213031304130513061307130813091310131113121313131413151316131713181319132013211322132313241325132613271328132913301331133213331334133513361337133813391340134113421343134413451346134713481349135013511352135313541355135613571358135913601361136213631364136513661367136813691370137113721373137413751376137713781379138013811382138313841385138613871388138913901391139213931394139513961397139813991400140114021403140414051406140714081409141014111412141314141415141614171418141914201421142214231424142514261427142814291430143114321433143414351436143714381439144014411442144314441445144614471448144914501451145214531454145514561457145814591460146114621463146414651466146714681469147014711472147314741475147614771478147914801481148214831484148514861487148814891490149114921493149414951496149714981499150015011502150315041505150615071508150915101511151215131514151515161517151815191520152115221523152415251526152715281529153015311532153315341535153615371538153915401541154215431544154515461547154815491550155115521553155415551556155715581559156015611562156315641565156615671568156915701571157215731574157515761577157815791580158115821583158415851586158715881589159015911592159315941595159615971598159916001601160216031604160516061607160816091610161116121613161416151616161716181619162016211622162316241625162616271628162916301631163216331634163516361637163816391640164116421643164416451646164716481649165016511652165316541655165616571658165916601661166216631664166516661667166816691670167116721673167416751676167716781679168016811682168316841685168616871688168916901691169216931694169516961697169816991700170117021703170417051706170717081709171017111712171317141715171617171718171917201721172217231724172517261727172817291730173117321733173417351736173717381739174017411742174317441745174617471748174917501751175217531754175517561757175817591760176117621763176417651766176717681769177017711772177317741775177617771778177917801781178217831784178517861787178817891790179117921793179417951796179717981799180018011802180318041805180618071808180918101811181218131814181518161817181818191820182118221823182418251826182718281829183018311832183318341835183618371838183918401841184218431844184518461847184818491850185118521853185418551856185718581859186018611862186318641865186618671868186918701871187218731874187518761877187818791880188118821883188418851886188718881889189018911892189318941895189618971898189919001901190219031904190519061907190819091910191119121913191419151916191719181919192019211922192319241925192619271928192919301931193219331934193519361937193819391940194119421943194419451946194719481949195019511952195319541955195619571958195919601961196219631964196519661967196819691970197119721973197419751976197719781979198019811982198319841985198619871988198919901991199219931994199519961997199819992000200120022003200420052006200720082009201020112012201320142015201620172018201920202021202220232024202520262027202820292030203120322033203420352036203720382039204020412042204320442045204620472048204920502051205220532054205520562057205820592060206120622063206420652066206720682069207020712072207320742075207620772078207920802081208220832084208520862087208820892090209120922093209420952096209720982099210021012102210321042105210621072108210921102111211221132114211521162117211821192120212121222123212421252126212721282129213021312132213321342135213621372138213921402141214221432144214521462147214821492150215121522153215421552156215721582159216021612162216321642165216621672168216921702171217221732174217521762177217821792180218121822183218421852186218721882189219021912192219321942195219621972198219922002201220222032204220522062207220822092210221122122213221422152216221722182219222022212222222322242225222622272228222922302231223222332234223522362237223822392240224122422243224422452246224722482249225022512252225322542255225622572258225922602261226222632264226522662267226822692270227122722273227422752276227722782279228022812282228322842285228622872288228922902291229222932294229522962297229822992300230123022303230423052306230723082309231023112312231323142315231623172318231923202321232223232324232523262327232823292330233123322333233423352336233723382339234023412342234323442345234623472348234923502351235223532354235523562357235823592360236123622363236423652366236723682369237023712372237323742375237623772378237923802381238223832384238523862387238823892390239123922393239423952396239723982399240024012402240324042405240624072408240924102411241224132414241524162417241824192420242124222423242424252426242724282429243024312432243324342435243624372438243924402441244224432444244524462447244824492450245124522453245424552456245724582459246024612462246324642465246624672468246924702471247224732474247524762477247824792480248124822483248424852486248724882489249024912492249324942495249624972498249925002501250225032504250525062507250825092510251125122513251425152516251725182519252025212522252325242525252625272528252925302531253225332534253525362537253825392540254125422543254425452546254725482549255025512552255325542555255625572558255925602561256225632564256525662567256825692570257125722573257425752576257725782579258025812582258325842585258625872588258925902591259225932594259525962597259825992600260126022603260426052606260726082609261026112612261326142615261626172618261926202621262226232624262526262627262826292630263126322633263426352636263726382639264026412642264326442645264626472648264926502651265226532654265526562657265826592660266126622663266426652666266726682669267026712672267326742675267626772678267926802681268226832684268526862687268826892690269126922693269426952696269726982699270027012702270327042705270627072708270927102711271227132714271527162717271827192720272127222723272427252726272727282729273027312732273327342735273627372738273927402741274227432744274527462747274827492750275127522753275427552756275727582759276027612762276327642765276627672768276927702771277227732774277527762777277827792780278127822783278427852786278727882789279027912792279327942795279627972798279928002801280228032804280528062807280828092810281128122813281428152816281728182819282028212822282328242825282628272828282928302831283228332834283528362837283828392840284128422843284428452846284728482849285028512852285328542855285628572858285928602861286228632864286528662867286828692870287128722873287428752876287728782879288028812882288328842885288628872888288928902891289228932894289528962897289828992900290129022903290429052906290729082909291029112912291329142915291629172918291929202921292229232924292529262927292829292930293129322933293429352936293729382939294029412942294329442945294629472948294929502951295229532954295529562957295829592960296129622963296429652966296729682969297029712972297329742975297629772978297929802981
  1. <?php
  2. /**
  3. * Base class that represents a row from the 'katao_node' table.
  4. *
  5. *
  6. *
  7. * @package lib.model.om
  8. */
  9. abstract class BaseKataoNode extends BaseObject implements Persistent {
  10. /**
  11. * The Peer class.
  12. * Instance provides a convenient way of calling static methods on a class
  13. * that calling code may not be able to identify.
  14. * @var KataoNodePeer
  15. */
  16. protected static $peer;
  17. /**
  18. * The value for the id field.
  19. * @var int
  20. */
  21. protected $id;
  22. /**
  23. * The value for the city field.
  24. * @var string
  25. */
  26. protected $city;
  27. /**
  28. * The value for the responsible field.
  29. * @var int
  30. */
  31. protected $responsible;
  32. /**
  33. * The value for the begin_at field.
  34. * @var int
  35. */
  36. protected $begin_at;
  37. /**
  38. * The value for the is_default field.
  39. * @var int
  40. */
  41. protected $is_default = 0;
  42. /**
  43. * The value for the created_at field.
  44. * @var int
  45. */
  46. protected $created_at;
  47. /**
  48. * The value for the updated_at field.
  49. * @var int
  50. */
  51. protected $updated_at;
  52. /**
  53. * @var KataoUser
  54. */
  55. protected $aKataoUser;
  56. /**
  57. * Collection to store aggregation of collKataoMembersRelatedByKataoNodeId.
  58. * @var array
  59. */
  60. protected $collKataoMembersRelatedByKataoNodeId;
  61. /**
  62. * The criteria used to select the current contents of collKataoMembersRelatedByKataoNodeId.
  63. * @var Criteria
  64. */
  65. protected $lastKataoMemberRelatedByKataoNodeIdCriteria = null;
  66. /**
  67. * Collection to store aggregation of collKataoMembersRelatedByNextKataoNodeId.
  68. * @var array
  69. */
  70. protected $collKataoMembersRelatedByNextKataoNodeId;
  71. /**
  72. * The criteria used to select the current contents of collKataoMembersRelatedByNextKataoNodeId.
  73. * @var Criteria
  74. */
  75. protected $lastKataoMemberRelatedByNextKataoNodeIdCriteria = null;
  76. /**
  77. * Collection to store aggregation of collKataoSupplierNodes.
  78. * @var array
  79. */
  80. protected $collKataoSupplierNodes;
  81. /**
  82. * The criteria used to select the current contents of collKataoSupplierNodes.
  83. * @var Criteria
  84. */
  85. protected $lastKataoSupplierNodeCriteria = null;
  86. /**
  87. * Collection to store aggregation of collKataoNodeProducts.
  88. * @var array
  89. */
  90. protected $collKataoNodeProducts;
  91. /**
  92. * The criteria used to select the current contents of collKataoNodeProducts.
  93. * @var Criteria
  94. */
  95. protected $lastKataoNodeProductCriteria = null;
  96. /**
  97. * Collection to store aggregation of collKataoNodeSuppliers.
  98. * @var array
  99. */
  100. protected $collKataoNodeSuppliers;
  101. /**
  102. * The criteria used to select the current contents of collKataoNodeSuppliers.
  103. * @var Criteria
  104. */
  105. protected $lastKataoNodeSupplierCriteria = null;
  106. /**
  107. * Collection to store aggregation of collKataoCarts.
  108. * @var array
  109. */
  110. protected $collKataoCarts;
  111. /**
  112. * The criteria used to select the current contents of collKataoCarts.
  113. * @var Criteria
  114. */
  115. protected $lastKataoCartCriteria = null;
  116. /**
  117. * Collection to store aggregation of collKataoOrders.
  118. * @var array
  119. */
  120. protected $collKataoOrders;
  121. /**
  122. * The criteria used to select the current contents of collKataoOrders.
  123. * @var Criteria
  124. */
  125. protected $lastKataoOrderCriteria = null;
  126. /**
  127. * Collection to store aggregation of collKataoInvoices.
  128. * @var array
  129. */
  130. protected $collKataoInvoices;
  131. /**
  132. * The criteria used to select the current contents of collKataoInvoices.
  133. * @var Criteria
  134. */
  135. protected $lastKataoInvoiceCriteria = null;
  136. /**
  137. * Collection to store aggregation of collKataoMemberNodes.
  138. * @var array
  139. */
  140. protected $collKataoMemberNodes;
  141. /**
  142. * The criteria used to select the current contents of collKataoMemberNodes.
  143. * @var Criteria
  144. */
  145. protected $lastKataoMemberNodeCriteria = null;
  146. /**
  147. * Flag to prevent endless save loop, if this object is referenced
  148. * by another object which falls in this transaction.
  149. * @var boolean
  150. */
  151. protected $alreadyInSave = false;
  152. /**
  153. * Flag to prevent endless validation loop, if this object is referenced
  154. * by another object which falls in this transaction.
  155. * @var boolean
  156. */
  157. protected $alreadyInValidation = false;
  158. /**
  159. * Get the [id] column value.
  160. *
  161. * @return int
  162. */
  163. public function getId()
  164. {
  165. return $this->id;
  166. }
  167. /**
  168. * Get the [city] column value.
  169. *
  170. * @return string
  171. */
  172. public function getCity()
  173. {
  174. return $this->city;
  175. }
  176. /**
  177. * Get the [responsible] column value.
  178. *
  179. * @return int
  180. */
  181. public function getResponsible()
  182. {
  183. return $this->responsible;
  184. }
  185. /**
  186. * Get the [optionally formatted] [begin_at] column value.
  187. *
  188. * @param string $format The date/time format string (either date()-style or strftime()-style).
  189. * If format is NULL, then the integer unix timestamp will be returned.
  190. * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
  191. * @throws PropelException - if unable to convert the date/time to timestamp.
  192. */
  193. public function getBeginAt($format = 'Y-m-d H:i:s')
  194. {
  195. if ($this->begin_at === null || $this->begin_at === '') {
  196. return null;
  197. } elseif (!is_int($this->begin_at)) {
  198. // a non-timestamp value was set externally, so we convert it
  199. $ts = strtotime($this->begin_at);
  200. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  201. throw new PropelException("Unable to parse value of [begin_at] as date/time value: " . var_export($this->begin_at, true));
  202. }
  203. } else {
  204. $ts = $this->begin_at;
  205. }
  206. if ($format === null) {
  207. return $ts;
  208. } elseif (strpos($format, '%') !== false) {
  209. return strftime($format, $ts);
  210. } else {
  211. return date($format, $ts);
  212. }
  213. }
  214. /**
  215. * Get the [is_default] column value.
  216. *
  217. * @return int
  218. */
  219. public function getIsDefault()
  220. {
  221. return $this->is_default;
  222. }
  223. /**
  224. * Get the [optionally formatted] [created_at] column value.
  225. *
  226. * @param string $format The date/time format string (either date()-style or strftime()-style).
  227. * If format is NULL, then the integer unix timestamp will be returned.
  228. * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
  229. * @throws PropelException - if unable to convert the date/time to timestamp.
  230. */
  231. public function getCreatedAt($format = 'Y-m-d H:i:s')
  232. {
  233. if ($this->created_at === null || $this->created_at === '') {
  234. return null;
  235. } elseif (!is_int($this->created_at)) {
  236. // a non-timestamp value was set externally, so we convert it
  237. $ts = strtotime($this->created_at);
  238. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  239. throw new PropelException("Unable to parse value of [created_at] as date/time value: " . var_export($this->created_at, true));
  240. }
  241. } else {
  242. $ts = $this->created_at;
  243. }
  244. if ($format === null) {
  245. return $ts;
  246. } elseif (strpos($format, '%') !== false) {
  247. return strftime($format, $ts);
  248. } else {
  249. return date($format, $ts);
  250. }
  251. }
  252. /**
  253. * Get the [optionally formatted] [updated_at] column value.
  254. *
  255. * @param string $format The date/time format string (either date()-style or strftime()-style).
  256. * If format is NULL, then the integer unix timestamp will be returned.
  257. * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
  258. * @throws PropelException - if unable to convert the date/time to timestamp.
  259. */
  260. public function getUpdatedAt($format = 'Y-m-d H:i:s')
  261. {
  262. if ($this->updated_at === null || $this->updated_at === '') {
  263. return null;
  264. } elseif (!is_int($this->updated_at)) {
  265. // a non-timestamp value was set externally, so we convert it
  266. $ts = strtotime($this->updated_at);
  267. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  268. throw new PropelException("Unable to parse value of [updated_at] as date/time value: " . var_export($this->updated_at, true));
  269. }
  270. } else {
  271. $ts = $this->updated_at;
  272. }
  273. if ($format === null) {
  274. return $ts;
  275. } elseif (strpos($format, '%') !== false) {
  276. return strftime($format, $ts);
  277. } else {
  278. return date($format, $ts);
  279. }
  280. }
  281. /**
  282. * Set the value of [id] column.
  283. *
  284. * @param int $v new value
  285. * @return void
  286. */
  287. public function setId($v)
  288. {
  289. // Since the native PHP type for this column is integer,
  290. // we will cast the input value to an int (if it is not).
  291. if ($v !== null && !is_int($v) && is_numeric($v)) {
  292. $v = (int) $v;
  293. }
  294. if ($this->id !== $v) {
  295. $this->id = $v;
  296. $this->modifiedColumns[] = KataoNodePeer::ID;
  297. }
  298. } // setId()
  299. /**
  300. * Set the value of [city] column.
  301. *
  302. * @param string $v new value
  303. * @return void
  304. */
  305. public function setCity($v)
  306. {
  307. // Since the native PHP type for this column is string,
  308. // we will cast the input to a string (if it is not).
  309. if ($v !== null && !is_string($v)) {
  310. $v = (string) $v;
  311. }
  312. if ($this->city !== $v) {
  313. $this->city = $v;
  314. $this->modifiedColumns[] = KataoNodePeer::CITY;
  315. }
  316. } // setCity()
  317. /**
  318. * Set the value of [responsible] column.
  319. *
  320. * @param int $v new value
  321. * @return void
  322. */
  323. public function setResponsible($v)
  324. {
  325. // Since the native PHP type for this column is integer,
  326. // we will cast the input value to an int (if it is not).
  327. if ($v !== null && !is_int($v) && is_numeric($v)) {
  328. $v = (int) $v;
  329. }
  330. if ($this->responsible !== $v) {
  331. $this->responsible = $v;
  332. $this->modifiedColumns[] = KataoNodePeer::RESPONSIBLE;
  333. }
  334. if ($this->aKataoUser !== null && $this->aKataoUser->getId() !== $v) {
  335. $this->aKataoUser = null;
  336. }
  337. } // setResponsible()
  338. /**
  339. * Set the value of [begin_at] column.
  340. *
  341. * @param int $v new value
  342. * @return void
  343. */
  344. public function setBeginAt($v)
  345. {
  346. if ($v !== null && !is_int($v)) {
  347. $ts = strtotime($v);
  348. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  349. throw new PropelException("Unable to parse date/time value for [begin_at] from input: " . var_export($v, true));
  350. }
  351. } else {
  352. $ts = $v;
  353. }
  354. if ($this->begin_at !== $ts) {
  355. $this->begin_at = $ts;
  356. $this->modifiedColumns[] = KataoNodePeer::BEGIN_AT;
  357. }
  358. } // setBeginAt()
  359. /**
  360. * Set the value of [is_default] column.
  361. *
  362. * @param int $v new value
  363. * @return void
  364. */
  365. public function setIsDefault($v)
  366. {
  367. // Since the native PHP type for this column is integer,
  368. // we will cast the input value to an int (if it is not).
  369. if ($v !== null && !is_int($v) && is_numeric($v)) {
  370. $v = (int) $v;
  371. }
  372. if ($this->is_default !== $v || $v === 0) {
  373. $this->is_default = $v;
  374. $this->modifiedColumns[] = KataoNodePeer::IS_DEFAULT;
  375. }
  376. } // setIsDefault()
  377. /**
  378. * Set the value of [created_at] column.
  379. *
  380. * @param int $v new value
  381. * @return void
  382. */
  383. public function setCreatedAt($v)
  384. {
  385. if ($v !== null && !is_int($v)) {
  386. $ts = strtotime($v);
  387. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  388. throw new PropelException("Unable to parse date/time value for [created_at] from input: " . var_export($v, true));
  389. }
  390. } else {
  391. $ts = $v;
  392. }
  393. if ($this->created_at !== $ts) {
  394. $this->created_at = $ts;
  395. $this->modifiedColumns[] = KataoNodePeer::CREATED_AT;
  396. }
  397. } // setCreatedAt()
  398. /**
  399. * Set the value of [updated_at] column.
  400. *
  401. * @param int $v new value
  402. * @return void
  403. */
  404. public function setUpdatedAt($v)
  405. {
  406. if ($v !== null && !is_int($v)) {
  407. $ts = strtotime($v);
  408. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  409. throw new PropelException("Unable to parse date/time value for [updated_at] from input: " . var_export($v, true));
  410. }
  411. } else {
  412. $ts = $v;
  413. }
  414. if ($this->updated_at !== $ts) {
  415. $this->updated_at = $ts;
  416. $this->modifiedColumns[] = KataoNodePeer::UPDATED_AT;
  417. }
  418. } // setUpdatedAt()
  419. /**
  420. * Hydrates (populates) the object variables with values from the database resultset.
  421. *
  422. * An offset (1-based "start column") is specified so that objects can be hydrated
  423. * with a subset of the columns in the resultset rows. This is needed, for example,
  424. * for results of JOIN queries where the resultset row includes columns from two or
  425. * more tables.
  426. *
  427. * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
  428. * @param int $startcol 1-based offset column which indicates which restultset column to start with.
  429. * @return int next starting column
  430. * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
  431. */
  432. public function hydrate(ResultSet $rs, $startcol = 1)
  433. {
  434. try {
  435. $this->id = $rs->getInt($startcol + 0);
  436. $this->city = $rs->getString($startcol + 1);
  437. $this->responsible = $rs->getInt($startcol + 2);
  438. $this->begin_at = $rs->getTimestamp($startcol + 3, null);
  439. $this->is_default = $rs->getInt($startcol + 4);
  440. $this->created_at = $rs->getTimestamp($startcol + 5, null);
  441. $this->updated_at = $rs->getTimestamp($startcol + 6, null);
  442. $this->resetModified();
  443. $this->setNew(false);
  444. // FIXME - using NUM_COLUMNS may be clearer.
  445. return $startcol + 7; // 7 = KataoNodePeer::NUM_COLUMNS - KataoNodePeer::NUM_LAZY_LOAD_COLUMNS).
  446. } catch (Exception $e) {
  447. throw new PropelException("Error populating KataoNode object", $e);
  448. }
  449. }
  450. /**
  451. * Removes this object from datastore and sets delete attribute.
  452. *
  453. * @param Connection $con
  454. * @return void
  455. * @throws PropelException
  456. * @see BaseObject::setDeleted()
  457. * @see BaseObject::isDeleted()
  458. */
  459. public function delete($con = null)
  460. {
  461. foreach (sfMixer::getCallables('BaseKataoNode:delete:pre') as $callable)
  462. {
  463. $ret = call_user_func($callable, $this, $con);
  464. if ($ret)
  465. {
  466. return;
  467. }
  468. }
  469. if ($this->isDeleted()) {
  470. throw new PropelException("This object has already been deleted.");
  471. }
  472. if ($con === null) {
  473. $con = Propel::getConnection(KataoNodePeer::DATABASE_NAME);
  474. }
  475. try {
  476. $con->begin();
  477. KataoNodePeer::doDelete($this, $con);
  478. $this->setDeleted(true);
  479. $con->commit();
  480. } catch (PropelException $e) {
  481. $con->rollback();
  482. throw $e;
  483. }
  484. foreach (sfMixer::getCallables('BaseKataoNode:delete:post') as $callable)
  485. {
  486. call_user_func($callable, $this, $con);
  487. }
  488. }
  489. /**
  490. * Stores the object in the database. If the object is new,
  491. * it inserts it; otherwise an update is performed. This method
  492. * wraps the doSave() worker method in a transaction.
  493. *
  494. * @param Connection $con
  495. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  496. * @throws PropelException
  497. * @see doSave()
  498. */
  499. public function save($con = null)
  500. {
  501. foreach (sfMixer::getCallables('BaseKataoNode:save:pre') as $callable)
  502. {
  503. $affectedRows = call_user_func($callable, $this, $con);
  504. if (is_int($affectedRows))
  505. {
  506. return $affectedRows;
  507. }
  508. }
  509. if ($this->isNew() && !$this->isColumnModified(KataoNodePeer::CREATED_AT))
  510. {
  511. $this->setCreatedAt(time());
  512. }
  513. if ($this->isModified() && !$this->isColumnModified(KataoNodePeer::UPDATED_AT))
  514. {
  515. $this->setUpdatedAt(time());
  516. }
  517. if ($this->isDeleted()) {
  518. throw new PropelException("You cannot save an object that has been deleted.");
  519. }
  520. if ($con === null) {
  521. $con = Propel::getConnection(KataoNodePeer::DATABASE_NAME);
  522. }
  523. try {
  524. $con->begin();
  525. $affectedRows = $this->doSave($con);
  526. $con->commit();
  527. foreach (sfMixer::getCallables('BaseKataoNode:save:post') as $callable)
  528. {
  529. call_user_func($callable, $this, $con, $affectedRows);
  530. }
  531. return $affectedRows;
  532. } catch (PropelException $e) {
  533. $con->rollback();
  534. throw $e;
  535. }
  536. }
  537. /**
  538. * Stores the object in the database.
  539. *
  540. * If the object is new, it inserts it; otherwise an update is performed.
  541. * All related objects are also updated in this method.
  542. *
  543. * @param Connection $con
  544. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  545. * @throws PropelException
  546. * @see save()
  547. */
  548. protected function doSave($con)
  549. {
  550. $affectedRows = 0; // initialize var to track total num of affected rows
  551. if (!$this->alreadyInSave) {
  552. $this->alreadyInSave = true;
  553. // We call the save method on the following object(s) if they
  554. // were passed to this object by their coresponding set
  555. // method. This object relates to these object(s) by a
  556. // foreign key reference.
  557. if ($this->aKataoUser !== null) {
  558. if ($this->aKataoUser->isModified()) {
  559. $affectedRows += $this->aKataoUser->save($con);
  560. }
  561. $this->setKataoUser($this->aKataoUser);
  562. }
  563. // If this object has been modified, then save it to the database.
  564. if ($this->isModified()) {
  565. if ($this->isNew()) {
  566. $pk = KataoNodePeer::doInsert($this, $con);
  567. $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
  568. // should always be true here (even though technically
  569. // BasePeer::doInsert() can insert multiple rows).
  570. $this->setId($pk); //[IMV] update autoincrement primary key
  571. $this->setNew(false);
  572. } else {
  573. $affectedRows += KataoNodePeer::doUpdate($this, $con);
  574. }
  575. $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
  576. }
  577. if ($this->collKataoMembersRelatedByKataoNodeId !== null) {
  578. foreach($this->collKataoMembersRelatedByKataoNodeId as $referrerFK) {
  579. if (!$referrerFK->isDeleted()) {
  580. $affectedRows += $referrerFK->save($con);
  581. }
  582. }
  583. }
  584. if ($this->collKataoMembersRelatedByNextKataoNodeId !== null) {
  585. foreach($this->collKataoMembersRelatedByNextKataoNodeId as $referrerFK) {
  586. if (!$referrerFK->isDeleted()) {
  587. $affectedRows += $referrerFK->save($con);
  588. }
  589. }
  590. }
  591. if ($this->collKataoSupplierNodes !== null) {
  592. foreach($this->collKataoSupplierNodes as $referrerFK) {
  593. if (!$referrerFK->isDeleted()) {
  594. $affectedRows += $referrerFK->save($con);
  595. }
  596. }
  597. }
  598. if ($this->collKataoNodeProducts !== null) {
  599. foreach($this->collKataoNodeProducts as $referrerFK) {
  600. if (!$referrerFK->isDeleted()) {
  601. $affectedRows += $referrerFK->save($con);
  602. }
  603. }
  604. }
  605. if ($this->collKataoNodeSuppliers !== null) {
  606. foreach($this->collKataoNodeSuppliers as $referrerFK) {
  607. if (!$referrerFK->isDeleted()) {
  608. $affectedRows += $referrerFK->save($con);
  609. }
  610. }
  611. }
  612. if ($this->collKataoCarts !== null) {
  613. foreach($this->collKataoCarts as $referrerFK) {
  614. if (!$referrerFK->isDeleted()) {
  615. $affectedRows += $referrerFK->save($con);
  616. }
  617. }
  618. }
  619. if ($this->collKataoOrders !== null) {
  620. foreach($this->collKataoOrders as $referrerFK) {
  621. if (!$referrerFK->isDeleted()) {
  622. $affectedRows += $referrerFK->save($con);
  623. }
  624. }
  625. }
  626. if ($this->collKataoInvoices !== null) {
  627. foreach($this->collKataoInvoices as $referrerFK) {
  628. if (!$referrerFK->isDeleted()) {
  629. $affectedRows += $referrerFK->save($con);
  630. }
  631. }
  632. }
  633. if ($this->collKataoMemberNodes !== null) {
  634. foreach($this->collKataoMemberNodes as $referrerFK) {
  635. if (!$referrerFK->isDeleted()) {
  636. $affectedRows += $referrerFK->save($con);
  637. }
  638. }
  639. }
  640. $this->alreadyInSave = false;
  641. }
  642. return $affectedRows;
  643. } // doSave()
  644. /**
  645. * Array of ValidationFailed objects.
  646. * @var array ValidationFailed[]
  647. */
  648. protected $validationFailures = array();
  649. /**
  650. * Gets any ValidationFailed objects that resulted from last call to validate().
  651. *
  652. *
  653. * @return array ValidationFailed[]
  654. * @see validate()
  655. */
  656. public function getValidationFailures()
  657. {
  658. return $this->validationFailures;
  659. }
  660. /**
  661. * Validates the objects modified field values and all objects related to this table.
  662. *
  663. * If $columns is either a column name or an array of column names
  664. * only those columns are validated.
  665. *
  666. * @param mixed $columns Column name or an array of column names.
  667. * @return boolean Whether all columns pass validation.
  668. * @see doValidate()
  669. * @see getValidationFailures()
  670. */
  671. public function validate($columns = null)
  672. {
  673. $res = $this->doValidate($columns);
  674. if ($res === true) {
  675. $this->validationFailures = array();
  676. return true;
  677. } else {
  678. $this->validationFailures = $res;
  679. return false;
  680. }
  681. }
  682. /**
  683. * This function performs the validation work for complex object models.
  684. *
  685. * In addition to checking the current object, all related objects will
  686. * also be validated. If all pass then <code>true</code> is returned; otherwise
  687. * an aggreagated array of ValidationFailed objects will be returned.
  688. *
  689. * @param array $columns Array of column names to validate.
  690. * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
  691. */
  692. protected function doValidate($columns = null)
  693. {
  694. if (!$this->alreadyInValidation) {
  695. $this->alreadyInValidation = true;
  696. $retval = null;
  697. $failureMap = array();
  698. // We call the validate method on the following object(s) if they
  699. // were passed to this object by their coresponding set
  700. // method. This object relates to these object(s) by a
  701. // foreign key reference.
  702. if ($this->aKataoUser !== null) {
  703. if (!$this->aKataoUser->validate($columns)) {
  704. $failureMap = array_merge($failureMap, $this->aKataoUser->getValidationFailures());
  705. }
  706. }
  707. if (($retval = KataoNodePeer::doValidate($this, $columns)) !== true) {
  708. $failureMap = array_merge($failureMap, $retval);
  709. }
  710. if ($this->collKataoMembersRelatedByKataoNodeId !== null) {
  711. foreach($this->collKataoMembersRelatedByKataoNodeId as $referrerFK) {
  712. if (!$referrerFK->validate($columns)) {
  713. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  714. }
  715. }
  716. }
  717. if ($this->collKataoMembersRelatedByNextKataoNodeId !== null) {
  718. foreach($this->collKataoMembersRelatedByNextKataoNodeId as $referrerFK) {
  719. if (!$referrerFK->validate($columns)) {
  720. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  721. }
  722. }
  723. }
  724. if ($this->collKataoSupplierNodes !== null) {
  725. foreach($this->collKataoSupplierNodes as $referrerFK) {
  726. if (!$referrerFK->validate($columns)) {
  727. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  728. }
  729. }
  730. }
  731. if ($this->collKataoNodeProducts !== null) {
  732. foreach($this->collKataoNodeProducts as $referrerFK) {
  733. if (!$referrerFK->validate($columns)) {
  734. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  735. }
  736. }
  737. }
  738. if ($this->collKataoNodeSuppliers !== null) {
  739. foreach($this->collKataoNodeSuppliers as $referrerFK) {
  740. if (!$referrerFK->validate($columns)) {
  741. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  742. }
  743. }
  744. }
  745. if ($this->collKataoCarts !== null) {
  746. foreach($this->collKataoCarts as $referrerFK) {
  747. if (!$referrerFK->validate($columns)) {
  748. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  749. }
  750. }
  751. }
  752. if ($this->collKataoOrders !== null) {
  753. foreach($this->collKataoOrders as $referrerFK) {
  754. if (!$referrerFK->validate($columns)) {
  755. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  756. }
  757. }
  758. }
  759. if ($this->collKataoInvoices !== null) {
  760. foreach($this->collKataoInvoices as $referrerFK) {
  761. if (!$referrerFK->validate($columns)) {
  762. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  763. }
  764. }
  765. }
  766. if ($this->collKataoMemberNodes !== null) {
  767. foreach($this->collKataoMemberNodes as $referrerFK) {
  768. if (!$referrerFK->validate($columns)) {
  769. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  770. }
  771. }
  772. }
  773. $this->alreadyInValidation = false;
  774. }
  775. return (!empty($failureMap) ? $failureMap : true);
  776. }
  777. /**
  778. * Retrieves a field from the object by name passed in as a string.
  779. *
  780. * @param string $name name
  781. * @param string $type The type of fieldname the $name is of:
  782. * one of the class type constants TYPE_PHPNAME,
  783. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  784. * @return mixed Value of field.
  785. */
  786. public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
  787. {
  788. $pos = KataoNodePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  789. return $this->getByPosition($pos);
  790. }
  791. /**
  792. * Retrieves a field from the object by Position as specified in the xml schema.
  793. * Zero-based.
  794. *
  795. * @param int $pos position in xml schema
  796. * @return mixed Value of field at $pos
  797. */
  798. public function getByPosition($pos)
  799. {
  800. switch($pos) {
  801. case 0:
  802. return $this->getId();
  803. break;
  804. case 1:
  805. return $this->getCity();
  806. break;
  807. case 2:
  808. return $this->getResponsible();
  809. break;
  810. case 3:
  811. return $this->getBeginAt();
  812. break;
  813. case 4:
  814. return $this->getIsDefault();
  815. break;
  816. case 5:
  817. return $this->getCreatedAt();
  818. break;
  819. case 6:
  820. return $this->getUpdatedAt();
  821. break;
  822. default:
  823. return null;
  824. break;
  825. } // switch()
  826. }
  827. /**
  828. * Exports the object as an array.
  829. *
  830. * You can specify the key type of the array by passing one of the class
  831. * type constants.
  832. *
  833. * @param string $keyType One of the class type constants TYPE_PHPNAME,
  834. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  835. * @return an associative array containing the field names (as keys) and field values
  836. */
  837. public function toArray($keyType = BasePeer::TYPE_PHPNAME)
  838. {
  839. $keys = KataoNodePeer::getFieldNames($keyType);
  840. $result = array(
  841. $keys[0] => $this->getId(),
  842. $keys[1] => $this->getCity(),
  843. $keys[2] => $this->getResponsible(),
  844. $keys[3] => $this->getBeginAt(),
  845. $keys[4] => $this->getIsDefault(),
  846. $keys[5] => $this->getCreatedAt(),
  847. $keys[6] => $this->getUpdatedAt(),
  848. );
  849. return $result;
  850. }
  851. /**
  852. * Sets a field from the object by name passed in as a string.
  853. *
  854. * @param string $name peer name
  855. * @param mixed $value field value
  856. * @param string $type The type of fieldname the $name is of:
  857. * one of the class type constants TYPE_PHPNAME,
  858. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  859. * @return void
  860. */
  861. public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
  862. {
  863. $pos = KataoNodePeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  864. return $this->setByPosition($pos, $value);
  865. }
  866. /**
  867. * Sets a field from the object by Position as specified in the xml schema.
  868. * Zero-based.
  869. *
  870. * @param int $pos position in xml schema
  871. * @param mixed $value field value
  872. * @return void
  873. */
  874. public function setByPosition($pos, $value)
  875. {
  876. switch($pos) {
  877. case 0:
  878. $this->setId($value);
  879. break;
  880. case 1:
  881. $this->setCity($value);
  882. break;
  883. case 2:
  884. $this->setResponsible($value);
  885. break;
  886. case 3:
  887. $this->setBeginAt($value);
  888. break;
  889. case 4:
  890. $this->setIsDefault($value);
  891. break;
  892. case 5:
  893. $this->setCreatedAt($value);
  894. break;
  895. case 6:
  896. $this->setUpdatedAt($value);
  897. break;
  898. } // switch()
  899. }
  900. /**
  901. * Populates the object using an array.
  902. *
  903. * This is particularly useful when populating an object from one of the
  904. * request arrays (e.g. $_POST). This method goes through the column
  905. * names, checking to see whether a matching key exists in populated
  906. * array. If so the setByName() method is called for that column.
  907. *
  908. * You can specify the key type of the array by additionally passing one
  909. * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
  910. * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
  911. *
  912. * @param array $arr An array to populate the object from.
  913. * @param string $keyType The type of keys the array uses.
  914. * @return void
  915. */
  916. public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
  917. {
  918. $keys = KataoNodePeer::getFieldNames($keyType);
  919. if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
  920. if (array_key_exists($keys[1], $arr)) $this->setCity($arr[$keys[1]]);
  921. if (array_key_exists($keys[2], $arr)) $this->setResponsible($arr[$keys[2]]);
  922. if (array_key_exists($keys[3], $arr)) $this->setBeginAt($arr[$keys[3]]);
  923. if (array_key_exists($keys[4], $arr)) $this->setIsDefault($arr[$keys[4]]);
  924. if (array_key_exists($keys[5], $arr)) $this->setCreatedAt($arr[$keys[5]]);
  925. if (array_key_exists($keys[6], $arr)) $this->setUpdatedAt($arr[$keys[6]]);
  926. }
  927. /**
  928. * Build a Criteria object containing the values of all modified columns in this object.
  929. *
  930. * @return Criteria The Criteria object containing all modified values.
  931. */
  932. public function buildCriteria()
  933. {
  934. $criteria = new Criteria(KataoNodePeer::DATABASE_NAME);
  935. if ($this->isColumnModified(KataoNodePeer::ID)) $criteria->add(KataoNodePeer::ID, $this->id);
  936. if ($this->isColumnModified(KataoNodePeer::CITY)) $criteria->add(KataoNodePeer::CITY, $this->city);
  937. if ($this->isColumnModified(KataoNodePeer::RESPONSIBLE)) $criteria->add(KataoNodePeer::RESPONSIBLE, $this->responsible);
  938. if ($this->isColumnModified(KataoNodePeer::BEGIN_AT)) $criteria->add(KataoNodePeer::BEGIN_AT, $this->begin_at);
  939. if ($this->isColumnModified(KataoNodePeer::IS_DEFAULT)) $criteria->add(KataoNodePeer::IS_DEFAULT, $this->is_default);
  940. if ($this->isColumnModified(KataoNodePeer::CREATED_AT)) $criteria->add(KataoNodePeer::CREATED_AT, $this->created_at);
  941. if ($this->isColumnModified(KataoNodePeer::UPDATED_AT)) $criteria->add(KataoNodePeer::UPDATED_AT, $this->updated_at);
  942. return $criteria;
  943. }
  944. /**
  945. * Builds a Criteria object containing the primary key for this object.
  946. *
  947. * Unlike buildCriteria() this method includes the primary key values regardless
  948. * of whether or not they have been modified.
  949. *
  950. * @return Criteria The Criteria object containing value(s) for primary key(s).
  951. */
  952. public function buildPkeyCriteria()
  953. {
  954. $criteria = new Criteria(KataoNodePeer::DATABASE_NAME);
  955. $criteria->add(KataoNodePeer::ID, $this->id);
  956. return $criteria;
  957. }
  958. /**
  959. * Returns the primary key for this object (row).
  960. * @return int
  961. */
  962. public function getPrimaryKey()
  963. {
  964. return $this->getId();
  965. }
  966. /**
  967. * Generic method to set the primary key (id column).
  968. *
  969. * @param int $key Primary key.
  970. * @return void
  971. */
  972. public function setPrimaryKey($key)
  973. {
  974. $this->setId($key);
  975. }
  976. /**
  977. * Sets contents of passed object to values from current object.
  978. *
  979. * If desired, this method can also make copies of all associated (fkey referrers)
  980. * objects.
  981. *
  982. * @param object $copyObj An object of KataoNode (or compatible) type.
  983. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  984. * @throws PropelException
  985. */
  986. public function copyInto($copyObj, $deepCopy = false)
  987. {
  988. $copyObj->setCity($this->city);
  989. $copyObj->setResponsible($this->responsible);
  990. $copyObj->setBeginAt($this->begin_at);
  991. $copyObj->setIsDefault($this->is_default);
  992. $copyObj->setCreatedAt($this->created_at);
  993. $copyObj->setUpdatedAt($this->updated_at);
  994. if ($deepCopy) {
  995. // important: temporarily setNew(false) because this affects the behavior of
  996. // the getter/setter methods for fkey referrer objects.
  997. $copyObj->setNew(false);
  998. foreach($this->getKataoMembersRelatedByKataoNodeId() as $relObj) {
  999. $copyObj->addKataoMemberRelatedByKataoNodeId($relObj->copy($deepCopy));
  1000. }
  1001. foreach($this->getKataoMembersRelatedByNextKataoNodeId() as $relObj) {
  1002. $copyObj->addKataoMemberRelatedByNextKataoNodeId($relObj->copy($deepCopy));
  1003. }
  1004. foreach($this->getKataoSupplierNodes() as $relObj) {
  1005. $copyObj->addKataoSupplierNode($relObj->copy($deepCopy));
  1006. }
  1007. foreach($this->getKataoNodeProducts() as $relObj) {
  1008. $copyObj->addKataoNodeProduct($relObj->copy($deepCopy));
  1009. }
  1010. foreach($this->getKataoNodeSuppliers() as $relObj) {
  1011. $copyObj->addKataoNodeSupplier($relObj->copy($deepCopy));
  1012. }
  1013. foreach($this->getKataoCarts() as $relObj) {
  1014. $copyObj->addKataoCart($relObj->copy($deepCopy));
  1015. }
  1016. foreach($this->getKataoOrders() as $relObj) {
  1017. $copyObj->addKataoOrder($relObj->copy($deepCopy));
  1018. }
  1019. foreach($this->getKataoInvoices() as $relObj) {
  1020. $copyObj->addKataoInvoice($relObj->copy($deepCopy));
  1021. }
  1022. foreach($this->getKataoMemberNodes() as $relObj) {
  1023. $copyObj->addKataoMemberNode($relObj->copy($deepCopy));
  1024. }
  1025. } // if ($deepCopy)
  1026. $copyObj->setNew(true);
  1027. $copyObj->setId(NULL); // this is a pkey column, so set to default value
  1028. }
  1029. /**
  1030. * Makes a copy of this object that will be inserted as a new row in table when saved.
  1031. * It creates a new object filling in the simple attributes, but skipping any primary
  1032. * keys that are defined for the table.
  1033. *
  1034. * If desired, this method can also make copies of all associated (fkey referrers)
  1035. * objects.
  1036. *
  1037. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  1038. * @return KataoNode Clone of current object.
  1039. * @throws PropelException
  1040. */
  1041. public function copy($deepCopy = false)
  1042. {
  1043. // we use get_class(), because this might be a subclass
  1044. $clazz = get_class($this);
  1045. $copyObj = new $clazz();
  1046. $this->copyInto($copyObj, $deepCopy);
  1047. return $copyObj;
  1048. }
  1049. /**
  1050. * Returns a peer instance associated with this om.
  1051. *
  1052. * Since Peer classes are not to have any instance attributes, this method returns the
  1053. * same instance for all member of this class. The method could therefore
  1054. * be static, but this would prevent one from overriding the behavior.
  1055. *
  1056. * @return KataoNodePeer
  1057. */
  1058. public function getPeer()
  1059. {
  1060. if (self::$peer === null) {
  1061. self::$peer = new KataoNodePeer();
  1062. }
  1063. return self::$peer;
  1064. }
  1065. /**
  1066. * Declares an association between this object and a KataoUser object.
  1067. *
  1068. * @param KataoUser $v
  1069. * @return void
  1070. * @throws PropelException
  1071. */
  1072. public function setKataoUser($v)
  1073. {
  1074. if ($v === null) {
  1075. $this->setResponsible(NULL);
  1076. } else {
  1077. $this->setResponsible($v->getId());
  1078. }
  1079. $this->aKataoUser = $v;
  1080. }
  1081. /**
  1082. * Get the associated KataoUser object
  1083. *
  1084. * @param Connection Optional Connection object.
  1085. * @return KataoUser The associated KataoUser object.
  1086. * @throws PropelException
  1087. */
  1088. public function getKataoUser($con = null)
  1089. {
  1090. if ($this->aKataoUser === null && ($this->responsible !== null)) {
  1091. // include the related Peer class
  1092. $this->aKataoUser = KataoUserPeer::retrieveByPK($this->responsible, $con);
  1093. /* The following can be used instead of the line above to
  1094. guarantee the related object contains a reference
  1095. to this object, but this level of coupling
  1096. may be undesirable in many circumstances.
  1097. As it can lead to a db query with many results that may
  1098. never be used.
  1099. $obj = KataoUserPeer::retrieveByPK($this->responsible, $con);
  1100. $obj->addKataoUsers($this);
  1101. */
  1102. }
  1103. return $this->aKataoUser;
  1104. }
  1105. /**
  1106. * Temporary storage of collKataoMembersRelatedByKataoNodeId to save a possible db hit in
  1107. * the event objects are add to the collection, but the
  1108. * complete collection is never requested.
  1109. * @return void
  1110. */
  1111. public function initKataoMembersRelatedByKataoNodeId()
  1112. {
  1113. if ($this->collKataoMembersRelatedByKataoNodeId === null) {
  1114. $this->collKataoMembersRelatedByKataoNodeId = array();
  1115. }
  1116. }
  1117. /**
  1118. * If this collection has already been initialized with
  1119. * an identical criteria, it returns the collection.
  1120. * Otherwise if this KataoNode has previously
  1121. * been saved, it will retrieve related KataoMembersRelatedByKataoNodeId from storage.
  1122. * If this KataoNode is new, it will return
  1123. * an empty collection or the current collection, the criteria
  1124. * is ignored on a new object.
  1125. *
  1126. * @param Connection $con
  1127. * @param Criteria $criteria
  1128. * @throws PropelException
  1129. */
  1130. public function getKataoMembersRelatedByKataoNodeId($criteria = null, $con = null)
  1131. {
  1132. // include the Peer class
  1133. if ($criteria === null) {
  1134. $criteria = new Criteria();
  1135. }
  1136. elseif ($criteria instanceof Criteria)
  1137. {
  1138. $criteria = clone $criteria;
  1139. }
  1140. if ($this->collKataoMembersRelatedByKataoNodeId === null) {
  1141. if ($this->isNew()) {
  1142. $this->collKataoMembersRelatedByKataoNodeId = array();
  1143. } else {
  1144. $criteria->add(KataoMemberPeer::KATAO_NODE_ID, $this->getId());
  1145. KataoMemberPeer::addSelectColumns($criteria);
  1146. $this->collKataoMembersRelatedByKataoNodeId = KataoMemberPeer::doSelect($criteria, $con);
  1147. }
  1148. } else {
  1149. // criteria has no effect for a new object
  1150. if (!$this->isNew()) {
  1151. // the following code is to determine if a new query is
  1152. // called for. If the criteria is the same as the last
  1153. // one, just return the collection.
  1154. $criteria->add(KataoMemberPeer::KATAO_NODE_ID, $this->getId());
  1155. KataoMemberPeer::addSelectColumns($criteria);
  1156. if (!isset($this->lastKataoMemberRelatedByKataoNodeIdCriteria) || !$this->lastKataoMemberRelatedByKataoNodeIdCriteria->equals($criteria)) {
  1157. $this->collKataoMembersRelatedByKataoNodeId = KataoMemberPeer::doSelect($criteria, $con);
  1158. }
  1159. }
  1160. }
  1161. $this->lastKataoMemberRelatedByKataoNodeIdCriteria = $criteria;
  1162. return $this->collKataoMembersRelatedByKataoNodeId;
  1163. }
  1164. /**
  1165. * Returns the number of related KataoMembersRelatedByKataoNodeId.
  1166. *
  1167. * @param Criteria $criteria
  1168. * @param boolean $distinct
  1169. * @param Connection $con
  1170. * @throws PropelException
  1171. */
  1172. public function countKataoMembersRelatedByKataoNodeId($criteria = null, $distinct = false, $con = null)
  1173. {
  1174. // include the Peer class
  1175. if ($criteria === null) {
  1176. $criteria = new Criteria();
  1177. }
  1178. elseif ($criteria instanceof Criteria)
  1179. {
  1180. $criteria = clone $criteria;
  1181. }
  1182. $criteria->add(KataoMemberPeer::KATAO_NODE_ID, $this->getId());
  1183. return KataoMemberPeer::doCount($criteria, $distinct, $con);
  1184. }
  1185. /**
  1186. * Method called to associate a KataoMember object to this object
  1187. * through the KataoMember foreign key attribute
  1188. *
  1189. * @param KataoMember $l KataoMember
  1190. * @return void
  1191. * @throws PropelException
  1192. */
  1193. public function addKataoMemberRelatedByKataoNodeId(KataoMember $l)
  1194. {
  1195. $this->collKataoMembersRelatedByKataoNodeId[] = $l;
  1196. $l->setKataoNodeRelatedByKataoNodeId($this);
  1197. }
  1198. /**
  1199. * If this collection has already been initialized with
  1200. * an identical criteria, it returns the collection.
  1201. * Otherwise if this KataoNode is new, it will return
  1202. * an empty collection; or if this KataoNode has previously
  1203. * been saved, it will retrieve related KataoMembersRelatedByKataoNodeId from storage.
  1204. *
  1205. * This method is protected by default in order to keep the public
  1206. * api reasonable. You can provide public methods for those you
  1207. * actually need in KataoNode.
  1208. */
  1209. public function getKataoMembersRelatedByKataoNodeIdJoinKataoMemberRelatedByKataoMemberId($criteria = null, $con = null)
  1210. {
  1211. // include the Peer class
  1212. if ($criteria === null) {
  1213. $criteria = new Criteria();
  1214. }
  1215. elseif ($criteria instanceof Criteria)
  1216. {
  1217. $criteria = clone $criteria;
  1218. }
  1219. if ($this->collKataoMembersRelatedByKataoNodeId === null) {
  1220. if ($this->isNew()) {
  1221. $this->collKataoMembersRelatedByKataoNodeId = array();
  1222. } else {
  1223. $criteria->add(KataoMemberPeer::KATAO_NODE_ID, $this->getId());
  1224. $this->collKataoMembersRelatedByKataoNodeId = KataoMemberPeer::doSelectJoinKataoMemberRelatedByKataoMemberId($criteria, $con);
  1225. }
  1226. } else {
  1227. // the following code is to determine if a new query is
  1228. // called for. If the criteria is the same as the last
  1229. // one, just return the collection.
  1230. $criteria->add(KataoMemberPeer::KATAO_NODE_ID, $this->getId());
  1231. if (!isset($this->lastKataoMemberRelatedByKataoNodeIdCriteria) || !$this->lastKataoMemberRelatedByKataoNodeIdCriteria->equals($criteria)) {
  1232. $this->collKataoMembersRelatedByKataoNodeId = KataoMemberPeer::doSelectJoinKataoMemberRelatedByKataoMemberId($criteria, $con);
  1233. }
  1234. }
  1235. $this->lastKataoMemberRelatedByKataoNodeIdCriteria = $criteria;
  1236. return $this->collKataoMembersRelatedByKataoNodeId;
  1237. }
  1238. /**
  1239. * Temporary storage of collKataoMembersRelatedByNextKataoNodeId to save a possible db hit in
  1240. * the event objects are add to the collection, but the
  1241. * complete collection is never requested.
  1242. * @return void
  1243. */
  1244. public function initKataoMembersRelatedByNextKataoNodeId()
  1245. {
  1246. if ($this->collKataoMembersRelatedByNextKataoNodeId === null) {
  1247. $this->collKataoMembersRelatedByNextKataoNodeId = array();
  1248. }
  1249. }
  1250. /**
  1251. * If this collection has already been initialized with
  1252. * an identical criteria, it returns the collection.
  1253. * Otherwise if this KataoNode has previously
  1254. * been saved, it will retrieve related KataoMembersRelatedByNextKataoNodeId from storage.
  1255. * If this KataoNode is new, it will return
  1256. * an empty collection or the current collection, the criteria
  1257. * is ignored on a new object.
  1258. *
  1259. * @param Connection $con
  1260. * @param Criteria $criteria
  1261. * @throws PropelException
  1262. */
  1263. public function getKataoMembersRelatedByNextKataoNodeId($criteria = null, $con = null)
  1264. {
  1265. // include the Peer class
  1266. if ($criteria === null) {
  1267. $criteria = new Criteria();
  1268. }
  1269. elseif ($criteria instanceof Criteria)
  1270. {
  1271. $criteria = clone $criteria;
  1272. }
  1273. if ($this->collKataoMembersRelatedByNextKataoNodeId === null) {
  1274. if ($this->isNew()) {
  1275. $this->collKataoMembersRelatedByNextKataoNodeId = array();
  1276. } else {
  1277. $criteria->add(KataoMemberPeer::NEXT_KATAO_NODE_ID, $this->getId());
  1278. KataoMemberPeer::addSelectColumns($criteria);
  1279. $this->collKataoMembersRelatedByNextKataoNodeId = KataoMemberPeer::doSelect($criteria, $con);
  1280. }
  1281. } else {
  1282. // criteria has no effect for a new object
  1283. if (!$this->isNew()) {
  1284. // the following code is to determine if a new query is
  1285. // called for. If the criteria is the same as the last
  1286. // one, just return the collection.
  1287. $criteria->add(KataoMemberPeer::NEXT_KATAO_NODE_ID, $this->getId());
  1288. KataoMemberPeer::addSelectColumns($criteria);
  1289. if (!isset($this->lastKataoMemberRelatedByNextKataoNodeIdCriteria) || !$this->lastKataoMemberRelatedByNextKataoNodeIdCriteria->equals($criteria)) {
  1290. $this->collKataoMembersRelatedByNextKataoNodeId = KataoMemberPeer::doSelect($criteria, $con);
  1291. }
  1292. }
  1293. }
  1294. $this->lastKataoMemberRelatedByNextKataoNodeIdCriteria = $criteria;
  1295. return $this->collKataoMembersRelatedByNextKataoNodeId;
  1296. }
  1297. /**
  1298. * Returns the number of related KataoMembersRelatedByNextKataoNodeId.
  1299. *
  1300. * @param Criteria $criteria
  1301. * @param boolean $distinct
  1302. * @param Connection $con
  1303. * @throws PropelException
  1304. */
  1305. public function countKataoMembersRelatedByNextKataoNodeId($criteria = null, $distinct = false, $con = null)
  1306. {
  1307. // include the Peer class
  1308. if ($criteria === null) {
  1309. $criteria = new Criteria();
  1310. }
  1311. elseif ($criteria instanceof Criteria)
  1312. {
  1313. $criteria = clone $criteria;
  1314. }
  1315. $criteria->add(KataoMemberPeer::NEXT_KATAO_NODE_ID, $this->getId());
  1316. return KataoMemberPeer::doCount($criteria, $distinct, $con);
  1317. }
  1318. /**
  1319. * Method called to associate a KataoMember object to this object
  1320. * through the KataoMember foreign key attribute
  1321. *
  1322. * @param KataoMember $l KataoMember
  1323. * @return void
  1324. * @throws PropelException
  1325. */
  1326. public function addKataoMemberRelatedByNextKataoNodeId(KataoMember $l)
  1327. {
  1328. $this->collKataoMembersRelatedByNextKataoNodeId[] = $l;
  1329. $l->setKataoNodeRelatedByNextKataoNodeId($this);
  1330. }
  1331. /**
  1332. * If this collection has already been initialized with
  1333. * an identical criteria, it returns the collection.
  1334. * Otherwise if this KataoNode is new, it will return
  1335. * an empty collection; or if this KataoNode has previously
  1336. * been saved, it will retrieve related KataoMembersRelatedByNextKataoNodeId from storage.
  1337. *
  1338. * This method is protected by default in order to keep the public
  1339. * api reasonable. You can provide public methods for those you
  1340. * actually need in KataoNode.
  1341. */
  1342. public function getKataoMembersRelatedByNextKataoNodeIdJoinKataoMemberRelatedByKataoMemberId($criteria = null, $con = null)
  1343. {
  1344. // include the Peer class
  1345. if ($criteria === null) {
  1346. $criteria = new Criteria();
  1347. }
  1348. elseif ($criteria instanceof Criteria)
  1349. {
  1350. $criteria = clone $criteria;
  1351. }
  1352. if ($this->collKataoMembersRelatedByNextKataoNodeId === null) {
  1353. if ($this->isNew()) {
  1354. $this->collKataoMembersRelatedByNextKataoNodeId = array();
  1355. } else {
  1356. $criteria->add(KataoMemberPeer::NEXT_KATAO_NODE_ID, $this->getId());
  1357. $this->collKataoMembersRelatedByNextKataoNodeId = KataoMemberPeer::doSelectJoinKataoMemberRelatedByKataoMemberId($criteria, $con);
  1358. }
  1359. } else {
  1360. // the following code is to determine if a new query is
  1361. // called for. If the criteria is the same as the last
  1362. // one, just return the collection.
  1363. $criteria->add(KataoMemberPeer::NEXT_KATAO_NODE_ID, $this->getId());
  1364. if (!isset($this->lastKataoMemberRelatedByNextKataoNodeIdCriteria) || !$this->lastKataoMemberRelatedByNextKataoNodeIdCriteria->equals($criteria)) {
  1365. $this->collKataoMembersRelatedByNextKataoNodeId = KataoMemberPeer::doSelectJoinKataoMemberRelatedByKataoMemberId($criteria, $con);
  1366. }
  1367. }
  1368. $this->lastKataoMemberRelatedByNextKataoNodeIdCriteria = $criteria;
  1369. return $this->collKataoMembersRelatedByNextKataoNodeId;
  1370. }
  1371. /**
  1372. * Temporary storage of collKataoSupplierNodes to save a possible db hit in
  1373. * the event objects are add to the collection, but the
  1374. * complete collection is never requested.
  1375. * @return void
  1376. */
  1377. public function initKataoSupplierNodes()
  1378. {
  1379. if ($this->collKataoSupplierNodes === null) {
  1380. $this->collKataoSupplierNodes = array();
  1381. }
  1382. }
  1383. /**
  1384. * If this collection has already been initialized with
  1385. * an identical criteria, it returns the collection.
  1386. * Otherwise if this KataoNode has previously
  1387. * been saved, it will retrieve related KataoSupplierNodes from storage.
  1388. * If this KataoNode is new, it will return
  1389. * an empty collection or the current collection, the criteria
  1390. * is ignored on a new object.
  1391. *
  1392. * @param Connection $con
  1393. * @param Criteria $criteria
  1394. * @throws PropelException
  1395. */
  1396. public function getKataoSupplierNodes($criteria = null, $con = null)
  1397. {
  1398. // include the Peer class
  1399. if ($criteria === null) {
  1400. $criteria = new Criteria();
  1401. }
  1402. elseif ($criteria instanceof Criteria)
  1403. {
  1404. $criteria = clone $criteria;
  1405. }
  1406. if ($this->collKataoSupplierNodes === null) {
  1407. if ($this->isNew()) {
  1408. $this->collKataoSupplierNodes = array();
  1409. } else {
  1410. $criteria->add(KataoSupplierNodePeer::KATAO_NODE_ID, $this->getId());
  1411. KataoSupplierNodePeer::addSelectColumns($criteria);
  1412. $this->collKataoSupplierNodes = KataoSupplierNodePeer::doSelect($criteria, $con);
  1413. }
  1414. } else {
  1415. // criteria has no effect for a new object
  1416. if (!$this->isNew()) {
  1417. // the following code is to determine if a new query is
  1418. // called for. If the criteria is the same as the last
  1419. // one, just return the collection.
  1420. $criteria->add(KataoSupplierNodePeer::KATAO_NODE_ID, $this->getId());
  1421. KataoSupplierNodePeer::addSelectColumns($criteria);
  1422. if (!isset($this->lastKataoSupplierNodeCriteria) || !$this->lastKataoSupplierNodeCriteria->equals($criteria)) {
  1423. $this->collKataoSupplierNodes = KataoSupplierNodePeer::doSelect($criteria, $con);
  1424. }
  1425. }
  1426. }
  1427. $this->lastKataoSupplierNodeCriteria = $criteria;
  1428. return $this->collKataoSupplierNodes;
  1429. }
  1430. /**
  1431. * Returns the number of related KataoSupplierNodes.
  1432. *
  1433. * @param Criteria $criteria
  1434. * @param boolean $distinct
  1435. * @param Connection $con
  1436. * @throws PropelException
  1437. */
  1438. public function countKataoSupplierNodes($criteria = null, $distinct = false, $con = null)
  1439. {
  1440. // include the Peer class
  1441. if ($criteria === null) {
  1442. $criteria = new Criteria();
  1443. }
  1444. elseif ($criteria instanceof Criteria)
  1445. {
  1446. $criteria = clone $criteria;
  1447. }
  1448. $criteria->add(KataoSupplierNodePeer::KATAO_NODE_ID, $this->getId());
  1449. return KataoSupplierNodePeer::doCount($criteria, $distinct, $con);
  1450. }
  1451. /**
  1452. * Method called to associate a KataoSupplierNode object to this object
  1453. * through the KataoSupplierNode foreign key attribute
  1454. *
  1455. * @param KataoSupplierNode $l KataoSupplierNode
  1456. * @return void
  1457. * @throws PropelException
  1458. */
  1459. public function addKataoSupplierNode(KataoSupplierNode $l)
  1460. {
  1461. $this->collKataoSupplierNodes[] = $l;
  1462. $l->setKataoNode($this);
  1463. }
  1464. /**
  1465. * If this collection has already been initialized with
  1466. * an identical criteria, it returns the collection.
  1467. * Otherwise if this KataoNode is new, it will return
  1468. * an empty collection; or if this KataoNode has previously
  1469. * been saved, it will retrieve related KataoSupplierNodes from storage.
  1470. *
  1471. * This method is protected by default in order to keep the public
  1472. * api reasonable. You can provide public methods for those you
  1473. * actually need in KataoNode.
  1474. */
  1475. public function getKataoSupplierNodesJoinKataoSupplier($criteria = null, $con = null)
  1476. {
  1477. // include the Peer class
  1478. if ($criteria === null) {
  1479. $criteria = new Criteria();
  1480. }
  1481. elseif ($criteria instanceof Criteria)
  1482. {
  1483. $criteria = clone $criteria;
  1484. }
  1485. if ($this->collKataoSupplierNodes === null) {
  1486. if ($this->isNew()) {
  1487. $this->collKataoSupplierNodes = array();
  1488. } else {
  1489. $criteria->add(KataoSupplierNodePeer::KATAO_NODE_ID, $this->getId());
  1490. $this->collKataoSupplierNodes = KataoSupplierNodePeer::doSelectJoinKataoSupplier($criteria, $con);
  1491. }
  1492. } else {
  1493. // the following code is to determine if a new query is
  1494. // called for. If the criteria is the same as the last
  1495. // one, just return the collection.
  1496. $criteria->add(KataoSupplierNodePeer::KATAO_NODE_ID, $this->getId());
  1497. if (!isset($this->lastKataoSupplierNodeCriteria) || !$this->lastKataoSupplierNodeCriteria->equals($criteria)) {
  1498. $this->collKataoSupplierNodes = KataoSupplierNodePeer::doSelectJoinKataoSupplier($criteria, $con);
  1499. }
  1500. }
  1501. $this->lastKataoSupplierNodeCriteria = $criteria;
  1502. return $this->collKataoSupplierNodes;
  1503. }
  1504. /**
  1505. * Temporary storage of collKataoNodeProducts to save a possible db hit in
  1506. * the event objects are add to the collection, but the
  1507. * complete collection is never requested.
  1508. * @return void
  1509. */
  1510. public function initKataoNodeProducts()
  1511. {
  1512. if ($this->collKataoNodeProducts === null) {
  1513. $this->collKataoNodeProducts = array();
  1514. }
  1515. }
  1516. /**
  1517. * If this collection has already been initialized with
  1518. * an identical criteria, it returns the collection.
  1519. * Otherwise if this KataoNode has previously
  1520. * been saved, it will retrieve related KataoNodeProducts from storage.
  1521. * If this KataoNode is new, it will return
  1522. * an empty collection or the current collection, the criteria
  1523. * is ignored on a new object.
  1524. *
  1525. * @param Connection $con
  1526. * @param Criteria $criteria
  1527. * @throws PropelException
  1528. */
  1529. public function getKataoNodeProducts($criteria = null, $con = null)
  1530. {
  1531. // include the Peer class
  1532. if ($criteria === null) {
  1533. $criteria = new Criteria();
  1534. }
  1535. elseif ($criteria instanceof Criteria)
  1536. {
  1537. $criteria = clone $criteria;
  1538. }
  1539. if ($this->collKataoNodeProducts === null) {
  1540. if ($this->isNew()) {
  1541. $this->collKataoNodeProducts = array();
  1542. } else {
  1543. $criteria->add(KataoNodeProductPeer::KATAO_NODE_ID, $this->getId());
  1544. KataoNodeProductPeer::addSelectColumns($criteria);
  1545. $this->collKataoNodeProducts = KataoNodeProductPeer::doSelect($criteria, $con);
  1546. }
  1547. } else {
  1548. // criteria has no effect for a new object
  1549. if (!$this->isNew()) {
  1550. // the following code is to determine if a new query is
  1551. // called for. If the criteria is the same as the last
  1552. // one, just return the collection.
  1553. $criteria->add(KataoNodeProductPeer::KATAO_NODE_ID, $this->getId());
  1554. KataoNodeProductPeer::addSelectColumns($criteria);
  1555. if (!isset($this->lastKataoNodeProductCriteria) || !$this->lastKataoNodeProductCriteria->equals($criteria)) {
  1556. $this->collKataoNodeProducts = KataoNodeProductPeer::doSelect($criteria, $con);
  1557. }
  1558. }
  1559. }
  1560. $this->lastKataoNodeProductCriteria = $criteria;
  1561. return $this->collKataoNodeProducts;
  1562. }
  1563. /**
  1564. * Returns the number of related KataoNodeProducts.
  1565. *
  1566. * @param Criteria $criteria
  1567. * @param boolean $distinct
  1568. * @param Connection $con
  1569. * @throws PropelException
  1570. */
  1571. public function countKataoNodeProducts($criteria = null, $distinct = false, $con = null)
  1572. {
  1573. // include the Peer class
  1574. if ($criteria === null) {
  1575. $criteria = new Criteria();
  1576. }
  1577. elseif ($criteria instanceof Criteria)
  1578. {
  1579. $criteria = clone $criteria;
  1580. }
  1581. $criteria->add(KataoNodeProductPeer::KATAO_NODE_ID, $this->getId());
  1582. return KataoNodeProductPeer::doCount($criteria, $distinct, $con);
  1583. }
  1584. /**
  1585. * Method called to associate a KataoNodeProduct object to this object
  1586. * through the KataoNodeProduct foreign key attribute
  1587. *
  1588. * @param KataoNodeProduct $l KataoNodeProduct
  1589. * @return void
  1590. * @throws PropelException
  1591. */
  1592. public function addKataoNodeProduct(KataoNodeProduct $l)
  1593. {
  1594. $this->collKataoNodeProducts[] = $l;
  1595. $l->setKataoNode($this);
  1596. }
  1597. /**
  1598. * If this collection has already been initialized with
  1599. * an identical criteria, it returns the collection.
  1600. * Otherwise if this KataoNode is new, it will return
  1601. * an empty collection; or if this KataoNode has previously
  1602. * been saved, it will retrieve related KataoNodeProducts from storage.
  1603. *
  1604. * This method is protected by default in order to keep the public
  1605. * api reasonable. You can provide public methods for those you
  1606. * actually need in KataoNode.
  1607. */
  1608. public function getKataoNodeProductsJoinKataoPeriod($criteria = null, $con = null)
  1609. {
  1610. // include the Peer class
  1611. if ($criteria === null) {
  1612. $criteria = new Criteria();
  1613. }
  1614. elseif ($criteria instanceof Criteria)
  1615. {
  1616. $criteria = clone $criteria;
  1617. }
  1618. if ($this->collKataoNodeProducts === null) {
  1619. if ($this->isNew()) {
  1620. $this->collKataoNodeProducts = array();
  1621. } else {
  1622. $criteria->add(KataoNodeProductPeer::KATAO_NODE_ID, $this->getId());
  1623. $this->collKataoNodeProducts = KataoNodeProductPeer::doSelectJoinKataoPeriod($criteria, $con);
  1624. }
  1625. } else {
  1626. // the following code is to determine if a new query is
  1627. // called for. If the criteria is the same as the last
  1628. // one, just return the collection.
  1629. $criteria->add(KataoNodeProductPeer::KATAO_NODE_ID, $this->getId());
  1630. if (!isset($this->lastKataoNodeProductCriteria) || !$this->lastKataoNodeProductCriteria->equals($criteria)) {
  1631. $this->collKataoNodeProducts = KataoNodeProductPeer::doSelectJoinKataoPeriod($criteria, $con);
  1632. }
  1633. }
  1634. $this->lastKataoNodeProductCriteria = $criteria;
  1635. return $this->collKataoNodeProducts;
  1636. }
  1637. /**
  1638. * If this collection has already been initialized with
  1639. * an identical criteria, it returns the collection.
  1640. * Otherwise if this KataoNode is new, it will return
  1641. * an empty collection; or if this KataoNode has previously
  1642. * been saved, it will retrieve related KataoNodeProducts from storage.
  1643. *
  1644. * This method is protected by default in order to keep the public
  1645. * api reasonable. You can provide public methods for those you
  1646. * actually need in KataoNode.
  1647. */
  1648. public function getKataoNodeProductsJoinKataoProduct($criteria = null, $con = null)
  1649. {
  1650. // include the Peer class
  1651. if ($criteria === null) {
  1652. $criteria = new Criteria();
  1653. }
  1654. elseif ($criteria instanceof Criteria)
  1655. {
  1656. $criteria = clone $criteria;
  1657. }
  1658. if ($this->collKataoNodeProducts === null) {
  1659. if ($this->isNew()) {
  1660. $this->collKataoNodeProducts = array();
  1661. } else {
  1662. $criteria->add(KataoNodeProductPeer::KATAO_NODE_ID, $this->getId());
  1663. $this->collKataoNodeProducts = KataoNodeProductPeer::doSelectJoinKataoProduct($criteria, $con);
  1664. }
  1665. } else {
  1666. // the following code is to determine if a new query is
  1667. // called for. If the criteria is the same as the last
  1668. // one, just return the collection.
  1669. $criteria->add(KataoNodeProductPeer::KATAO_NODE_ID, $this->getId());
  1670. if (!isset($this->lastKataoNodeProductCriteria) || !$this->lastKataoNodeProductCriteria->equals($criteria)) {
  1671. $this->collKataoNodeProducts = KataoNodeProductPeer::doSelectJoinKataoProduct($criteria, $con);
  1672. }
  1673. }
  1674. $this->lastKataoNodeProductCriteria = $criteria;
  1675. return $this->collKataoNodeProducts;
  1676. }
  1677. /**
  1678. * Temporary storage of collKataoNodeSuppliers to save a possible db hit in
  1679. * the event objects are add to the collection, but the
  1680. * complete collection is never requested.
  1681. * @return void
  1682. */
  1683. public function initKataoNodeSuppliers()
  1684. {
  1685. if ($this->collKataoNodeSuppliers === null) {
  1686. $this->collKataoNodeSuppliers = array();
  1687. }
  1688. }
  1689. /**
  1690. * If this collection has already been initialized with
  1691. * an identical criteria, it returns the collection.
  1692. * Otherwise if this KataoNode has previously
  1693. * been saved, it will retrieve related KataoNodeSuppliers from storage.
  1694. * If this KataoNode is new, it will return
  1695. * an empty collection or the current collection, the criteria
  1696. * is ignored on a new object.
  1697. *
  1698. * @param Connection $con
  1699. * @param Criteria $criteria
  1700. * @throws PropelException
  1701. */
  1702. public function getKataoNodeSuppliers($criteria = null, $con = null)
  1703. {
  1704. // include the Peer class
  1705. if ($criteria === null) {
  1706. $criteria = new Criteria();
  1707. }
  1708. elseif ($criteria instanceof Criteria)
  1709. {
  1710. $criteria = clone $criteria;
  1711. }
  1712. if ($this->collKataoNodeSuppliers === null) {
  1713. if ($this->isNew()) {
  1714. $this->collKataoNodeSuppliers = array();
  1715. } else {
  1716. $criteria->add(KataoNodeSupplierPeer::KATAO_NODE_ID, $this->getId());
  1717. KataoNodeSupplierPeer::addSelectColumns($criteria);
  1718. $this->collKataoNodeSuppliers = KataoNodeSupplierPeer::doSelect($criteria, $con);
  1719. }
  1720. } else {
  1721. // criteria has no effect for a new object
  1722. if (!$this->isNew()) {
  1723. // the following code is to determine if a new query is
  1724. // called for. If the criteria is the same as the last
  1725. // one, just return the collection.
  1726. $criteria->add(KataoNodeSupplierPeer::KATAO_NODE_ID, $this->getId());
  1727. KataoNodeSupplierPeer::addSelectColumns($criteria);
  1728. if (!isset($this->lastKataoNodeSupplierCriteria) || !$this->lastKataoNodeSupplierCriteria->equals($criteria)) {
  1729. $this->collKataoNodeSuppliers = KataoNodeSupplierPeer::doSelect($criteria, $con);
  1730. }
  1731. }
  1732. }
  1733. $this->lastKataoNodeSupplierCriteria = $criteria;
  1734. return $this->collKataoNodeSuppliers;
  1735. }
  1736. /**
  1737. * Returns the number of related KataoNodeSuppliers.
  1738. *
  1739. * @param Criteria $criteria
  1740. * @param boolean $distinct
  1741. * @param Connection $con
  1742. * @throws PropelException
  1743. */
  1744. public function countKataoNodeSuppliers($criteria = null, $distinct = false, $con = null)
  1745. {
  1746. // include the Peer class
  1747. if ($criteria === null) {
  1748. $criteria = new Criteria();
  1749. }
  1750. elseif ($criteria instanceof Criteria)
  1751. {
  1752. $criteria = clone $criteria;
  1753. }
  1754. $criteria->add(KataoNodeSupplierPeer::KATAO_NODE_ID, $this->getId());
  1755. return KataoNodeSupplierPeer::doCount($criteria, $distinct, $con);
  1756. }
  1757. /**
  1758. * Method called to associate a KataoNodeSupplier object to this object
  1759. * through the KataoNodeSupplier foreign key attribute
  1760. *
  1761. * @param KataoNodeSupplier $l KataoNodeSupplier
  1762. * @return void
  1763. * @throws PropelException
  1764. */
  1765. public function addKataoNodeSupplier(KataoNodeSupplier $l)
  1766. {
  1767. $this->collKataoNodeSuppliers[] = $l;
  1768. $l->setKataoNode($this);
  1769. }
  1770. /**
  1771. * If this collection has already been initialized with
  1772. * an identical criteria, it returns the collection.
  1773. * Otherwise if this KataoNode is new, it will return
  1774. * an empty collection; or if this KataoNode has previously
  1775. * been saved, it will retrieve related KataoNodeSuppliers from storage.
  1776. *
  1777. * This method is protected by default in order to keep the public
  1778. * api reasonable. You can provide public methods for those you
  1779. * actually need in KataoNode.
  1780. */
  1781. public function getKataoNodeSuppliersJoinKataoPeriod($criteria = null, $con = null)
  1782. {
  1783. // include the Peer class
  1784. if ($criteria === null) {
  1785. $criteria = new Criteria();
  1786. }
  1787. elseif ($criteria instanceof Criteria)
  1788. {
  1789. $criteria = clone $criteria;
  1790. }
  1791. if ($this->collKataoNodeSuppliers === null) {
  1792. if ($this->isNew()) {
  1793. $this->collKataoNodeSuppliers = array();
  1794. } else {
  1795. $criteria->add(KataoNodeSupplierPeer::KATAO_NODE_ID, $this->getId());
  1796. $this->collKataoNodeSuppliers = KataoNodeSupplierPeer::doSelectJoinKataoPeriod($criteria, $con);
  1797. }
  1798. } else {
  1799. // the following code is to determine if a new query is
  1800. // called for. If the criteria is the same as the last
  1801. // one, just return the collection.
  1802. $criteria->add(KataoNodeSupplierPeer::KATAO_NODE_ID, $this->getId());
  1803. if (!isset($this->lastKataoNodeSupplierCriteria) || !$this->lastKataoNodeSupplierCriteria->equals($criteria)) {
  1804. $this->collKataoNodeSuppliers = KataoNodeSupplierPeer::doSelectJoinKataoPeriod($criteria, $con);
  1805. }
  1806. }
  1807. $this->lastKataoNodeSupplierCriteria = $criteria;
  1808. return $this->collKataoNodeSuppliers;
  1809. }
  1810. /**
  1811. * If this collection has already been initialized with
  1812. * an identical criteria, it returns the collection.
  1813. * Otherwise if this KataoNode is new, it will return
  1814. * an empty collection; or if this KataoNode has previously
  1815. * been saved, it will retrieve related KataoNodeSuppliers from storage.
  1816. *
  1817. * This method is protected by default in order to keep the public
  1818. * api reasonable. You can provide public methods for those you
  1819. * actually need in KataoNode.
  1820. */
  1821. public function getKataoNodeSuppliersJoinKataoSupplier($criteria = null, $con = null)
  1822. {
  1823. // include the Peer class
  1824. if ($criteria === null) {
  1825. $criteria = new Criteria();
  1826. }
  1827. elseif ($criteria instanceof Criteria)
  1828. {
  1829. $criteria = clone $criteria;
  1830. }
  1831. if ($this->collKataoNodeSuppliers === null) {
  1832. if ($this->isNew()) {
  1833. $this->collKataoNodeSuppliers = array();
  1834. } else {
  1835. $criteria->add(KataoNodeSupplierPeer::KATAO_NODE_ID, $this->getId());
  1836. $this->collKataoNodeSuppliers = KataoNodeSupplierPeer::doSelectJoinKataoSupplier($criteria, $con);
  1837. }
  1838. } else {
  1839. // the following code is to determine if a new query is
  1840. // called for. If the criteria is the same as the last
  1841. // one, just return the collection.
  1842. $criteria->add(KataoNodeSupplierPeer::KATAO_NODE_ID, $this->getId());
  1843. if (!isset($this->lastKataoNodeSupplierCriteria) || !$this->lastKataoNodeSupplierCriteria->equals($criteria)) {
  1844. $this->collKataoNodeSuppliers = KataoNodeSupplierPeer::doSelectJoinKataoSupplier($criteria, $con);
  1845. }
  1846. }
  1847. $this->lastKataoNodeSupplierCriteria = $criteria;
  1848. return $this->collKataoNodeSuppliers;
  1849. }
  1850. /**
  1851. * Temporary storage of collKataoCarts to save a possible db hit in
  1852. * the event objects are add to the collection, but the
  1853. * complete collection is never requested.
  1854. * @return void
  1855. */
  1856. public function initKataoCarts()
  1857. {
  1858. if ($this->collKataoCarts === null) {
  1859. $this->collKataoCarts = array();
  1860. }
  1861. }
  1862. /**
  1863. * If this collection has already been initialized with
  1864. * an identical criteria, it returns the collection.
  1865. * Otherwise if this KataoNode has previously
  1866. * been saved, it will retrieve related KataoCarts from storage.
  1867. * If this KataoNode is new, it will return
  1868. * an empty collection or the current collection, the criteria
  1869. * is ignored on a new object.
  1870. *
  1871. * @param Connection $con
  1872. * @param Criteria $criteria
  1873. * @throws PropelException
  1874. */
  1875. public function getKataoCarts($criteria = null, $con = null)
  1876. {
  1877. // include the Peer class
  1878. if ($criteria === null) {
  1879. $criteria = new Criteria();
  1880. }
  1881. elseif ($criteria instanceof Criteria)
  1882. {
  1883. $criteria = clone $criteria;
  1884. }
  1885. if ($this->collKataoCarts === null) {
  1886. if ($this->isNew()) {
  1887. $this->collKataoCarts = array();
  1888. } else {
  1889. $criteria->add(KataoCartPeer::KATAO_NODE_ID, $this->getId());
  1890. KataoCartPeer::addSelectColumns($criteria);
  1891. $this->collKataoCarts = KataoCartPeer::doSelect($criteria, $con);
  1892. }
  1893. } else {
  1894. // criteria has no effect for a new object
  1895. if (!$this->isNew()) {
  1896. // the following code is to determine if a new query is
  1897. // called for. If the criteria is the same as the last
  1898. // one, just return the collection.
  1899. $criteria->add(KataoCartPeer::KATAO_NODE_ID, $this->getId());
  1900. KataoCartPeer::addSelectColumns($criteria);
  1901. if (!isset($this->lastKataoCartCriteria) || !$this->lastKataoCartCriteria->equals($criteria)) {
  1902. $this->collKataoCarts = KataoCartPeer::doSelect($criteria, $con);
  1903. }
  1904. }
  1905. }
  1906. $this->lastKataoCartCriteria = $criteria;
  1907. return $this->collKataoCarts;
  1908. }
  1909. /**
  1910. * Returns the number of related KataoCarts.
  1911. *
  1912. * @param Criteria $criteria
  1913. * @param boolean $distinct
  1914. * @param Connection $con
  1915. * @throws PropelException
  1916. */
  1917. public function countKataoCarts($criteria = null, $distinct = false, $con = null)
  1918. {
  1919. // include the Peer class
  1920. if ($criteria === null) {
  1921. $criteria = new Criteria();
  1922. }
  1923. elseif ($criteria instanceof Criteria)
  1924. {
  1925. $criteria = clone $criteria;
  1926. }
  1927. $criteria->add(KataoCartPeer::KATAO_NODE_ID, $this->getId());
  1928. return KataoCartPeer::doCount($criteria, $distinct, $con);
  1929. }
  1930. /**
  1931. * Method called to associate a KataoCart object to this object
  1932. * through the KataoCart foreign key attribute
  1933. *
  1934. * @param KataoCart $l KataoCart
  1935. * @return void
  1936. * @throws PropelException
  1937. */
  1938. public function addKataoCart(KataoCart $l)
  1939. {
  1940. $this->collKataoCarts[] = $l;
  1941. $l->setKataoNode($this);
  1942. }
  1943. /**
  1944. * If this collection has already been initialized with
  1945. * an identical criteria, it returns the collection.
  1946. * Otherwise if this KataoNode is new, it will return
  1947. * an empty collection; or if this KataoNode has previously
  1948. * been saved, it will retrieve related KataoCarts from storage.
  1949. *
  1950. * This method is protected by default in order to keep the public
  1951. * api reasonable. You can provide public methods for those you
  1952. * actually need in KataoNode.
  1953. */
  1954. public function getKataoCartsJoinKataoUser($criteria = null, $con = null)
  1955. {
  1956. // include the Peer class
  1957. if ($criteria === null) {
  1958. $criteria = new Criteria();
  1959. }
  1960. elseif ($criteria instanceof Criteria)
  1961. {
  1962. $criteria = clone $criteria;
  1963. }
  1964. if ($this->collKataoCarts === null) {
  1965. if ($this->isNew()) {
  1966. $this->collKataoCarts = array();
  1967. } else {
  1968. $criteria->add(KataoCartPeer::KATAO_NODE_ID, $this->getId());
  1969. $this->collKataoCarts = KataoCartPeer::doSelectJoinKataoUser($criteria, $con);
  1970. }
  1971. } else {
  1972. // the following code is to determine if a new query is
  1973. // called for. If the criteria is the same as the last
  1974. // one, just return the collection.
  1975. $criteria->add(KataoCartPeer::KATAO_NODE_ID, $this->getId());
  1976. if (!isset($this->lastKataoCartCriteria) || !$this->lastKataoCartCriteria->equals($criteria)) {
  1977. $this->collKataoCarts = KataoCartPeer::doSelectJoinKataoUser($criteria, $con);
  1978. }
  1979. }
  1980. $this->lastKataoCartCriteria = $criteria;
  1981. return $this->collKataoCarts;
  1982. }
  1983. /**
  1984. * If this collection has already been initialized with
  1985. * an identical criteria, it returns the collection.
  1986. * Otherwise if this KataoNode is new, it will return
  1987. * an empty collection; or if this KataoNode has previously
  1988. * been saved, it will retrieve related KataoCarts from storage.
  1989. *
  1990. * This method is protected by default in order to keep the public
  1991. * api reasonable. You can provide public methods for those you
  1992. * actually need in KataoNode.
  1993. */
  1994. public function getKataoCartsJoinKataoPeriod($criteria = null, $con = null)
  1995. {
  1996. // include the Peer class
  1997. if ($criteria === null) {
  1998. $criteria = new Criteria();
  1999. }
  2000. elseif ($criteria instanceof Criteria)
  2001. {
  2002. $criteria = clone $criteria;
  2003. }
  2004. if ($this->collKataoCarts === null) {
  2005. if ($this->isNew()) {
  2006. $this->collKataoCarts = array();
  2007. } else {
  2008. $criteria->add(KataoCartPeer::KATAO_NODE_ID, $this->getId());
  2009. $this->collKataoCarts = KataoCartPeer::doSelectJoinKataoPeriod($criteria, $con);
  2010. }
  2011. } else {
  2012. // the following code is to determine if a new query is
  2013. // called for. If the criteria is the same as the last
  2014. // one, just return the collection.
  2015. $criteria->add(KataoCartPeer::KATAO_NODE_ID, $this->getId());
  2016. if (!isset($this->lastKataoCartCriteria) || !$this->lastKataoCartCriteria->equals($criteria)) {
  2017. $this->collKataoCarts = KataoCartPeer::doSelectJoinKataoPeriod($criteria, $con);
  2018. }
  2019. }
  2020. $this->lastKataoCartCriteria = $criteria;
  2021. return $this->collKataoCarts;
  2022. }
  2023. /**
  2024. * Temporary storage of collKataoOrders to save a possible db hit in
  2025. * the event objects are add to the collection, but the
  2026. * complete collection is never requested.
  2027. * @return void
  2028. */
  2029. public function initKataoOrders()
  2030. {
  2031. if ($this->collKataoOrders === null) {
  2032. $this->collKataoOrders = array();
  2033. }
  2034. }
  2035. /**
  2036. * If this collection has already been initialized with
  2037. * an identical criteria, it returns the collection.
  2038. * Otherwise if this KataoNode has previously
  2039. * been saved, it will retrieve related KataoOrders from storage.
  2040. * If this KataoNode is new, it will return
  2041. * an empty collection or the current collection, the criteria
  2042. * is ignored on a new object.
  2043. *
  2044. * @param Connection $con
  2045. * @param Criteria $criteria
  2046. * @throws PropelException
  2047. */
  2048. public function getKataoOrders($criteria = null, $con = null)
  2049. {
  2050. // include the Peer class
  2051. if ($criteria === null) {
  2052. $criteria = new Criteria();
  2053. }
  2054. elseif ($criteria instanceof Criteria)
  2055. {
  2056. $criteria = clone $criteria;
  2057. }
  2058. if ($this->collKataoOrders === null) {
  2059. if ($this->isNew()) {
  2060. $this->collKataoOrders = array();
  2061. } else {
  2062. $criteria->add(KataoOrderPeer::KATAO_NODE_ID, $this->getId());
  2063. KataoOrderPeer::addSelectColumns($criteria);
  2064. $this->collKataoOrders = KataoOrderPeer::doSelect($criteria, $con);
  2065. }
  2066. } else {
  2067. // criteria has no effect for a new object
  2068. if (!$this->isNew()) {
  2069. // the following code is to determine if a new query is
  2070. // called for. If the criteria is the same as the last
  2071. // one, just return the collection.
  2072. $criteria->add(KataoOrderPeer::KATAO_NODE_ID, $this->getId());
  2073. KataoOrderPeer::addSelectColumns($criteria);
  2074. if (!isset($this->lastKataoOrderCriteria) || !$this->lastKataoOrderCriteria->equals($criteria)) {
  2075. $this->collKataoOrders = KataoOrderPeer::doSelect($criteria, $con);
  2076. }
  2077. }
  2078. }
  2079. $this->lastKataoOrderCriteria = $criteria;
  2080. return $this->collKataoOrders;
  2081. }
  2082. /**
  2083. * Returns the number of related KataoOrders.
  2084. *
  2085. * @param Criteria $criteria
  2086. * @param boolean $distinct
  2087. * @param Connection $con
  2088. * @throws PropelException
  2089. */
  2090. public function countKataoOrders($criteria = null, $distinct = false, $con = null)
  2091. {
  2092. // include the Peer class
  2093. if ($criteria === null) {
  2094. $criteria = new Criteria();
  2095. }
  2096. elseif ($criteria instanceof Criteria)
  2097. {
  2098. $criteria = clone $criteria;
  2099. }
  2100. $criteria->add(KataoOrderPeer::KATAO_NODE_ID, $this->getId());
  2101. return KataoOrderPeer::doCount($criteria, $distinct, $con);
  2102. }
  2103. /**
  2104. * Method called to associate a KataoOrder object to this object
  2105. * through the KataoOrder foreign key attribute
  2106. *
  2107. * @param KataoOrder $l KataoOrder
  2108. * @return void
  2109. * @throws PropelException
  2110. */
  2111. public function addKataoOrder(KataoOrder $l)
  2112. {
  2113. $this->collKataoOrders[] = $l;
  2114. $l->setKataoNode($this);
  2115. }
  2116. /**
  2117. * If this collection has already been initialized with
  2118. * an identical criteria, it returns the collection.
  2119. * Otherwise if this KataoNode is new, it will return
  2120. * an empty collection; or if this KataoNode has previously
  2121. * been saved, it will retrieve related KataoOrders from storage.
  2122. *
  2123. * This method is protected by default in order to keep the public
  2124. * api reasonable. You can provide public methods for those you
  2125. * actually need in KataoNode.
  2126. */
  2127. public function getKataoOrdersJoinKataoSupplier($criteria = null, $con = null)
  2128. {
  2129. // include the Peer class
  2130. if ($criteria === null) {
  2131. $criteria = new Criteria();
  2132. }
  2133. elseif ($criteria instanceof Criteria)
  2134. {
  2135. $criteria = clone $criteria;
  2136. }
  2137. if ($this->collKataoOrders === null) {
  2138. if ($this->isNew()) {
  2139. $this->collKataoOrders = array();
  2140. } else {
  2141. $criteria->add(KataoOrderPeer::KATAO_NODE_ID, $this->getId());
  2142. $this->collKataoOrders = KataoOrderPeer::doSelectJoinKataoSupplier($criteria, $con);
  2143. }
  2144. } else {
  2145. // the following code is to determine if a new query is
  2146. // called for. If the criteria is the same as the last
  2147. // one, just return the collection.
  2148. $criteria->add(KataoOrderPeer::KATAO_NODE_ID, $this->getId());
  2149. if (!isset($this->lastKataoOrderCriteria) || !$this->lastKataoOrderCriteria->equals($criteria)) {
  2150. $this->collKataoOrders = KataoOrderPeer::doSelectJoinKataoSupplier($criteria, $con);
  2151. }
  2152. }
  2153. $this->lastKataoOrderCriteria = $criteria;
  2154. return $this->collKataoOrders;
  2155. }
  2156. /**
  2157. * If this collection has already been initialized with
  2158. * an identical criteria, it returns the collection.
  2159. * Otherwise if this KataoNode is new, it will return
  2160. * an empty collection; or if this KataoNode has previously
  2161. * been saved, it will retrieve related KataoOrders from storage.
  2162. *
  2163. * This method is protected by default in order to keep the public
  2164. * api reasonable. You can provide public methods for those you
  2165. * actually need in KataoNode.
  2166. */
  2167. public function getKataoOrdersJoinKataoPeriod($criteria = null, $con = null)
  2168. {
  2169. // include the Peer class
  2170. if ($criteria === null) {
  2171. $criteria = new Criteria();
  2172. }
  2173. elseif ($criteria instanceof Criteria)
  2174. {
  2175. $criteria = clone $criteria;
  2176. }
  2177. if ($this->collKataoOrders === null) {
  2178. if ($this->isNew()) {
  2179. $this->collKataoOrders = array();
  2180. } else {
  2181. $criteria->add(KataoOrderPeer::KATAO_NODE_ID, $this->getId());
  2182. $this->collKataoOrders = KataoOrderPeer::doSelectJoinKataoPeriod($criteria, $con);
  2183. }
  2184. } else {
  2185. // the following code is to determine if a new query is
  2186. // called for. If the criteria is the same as the last
  2187. // one, just return the collection.
  2188. $criteria->add(KataoOrderPeer::KATAO_NODE_ID, $this->getId());
  2189. if (!isset($this->lastKataoOrderCriteria) || !$this->lastKataoOrderCriteria->equals($criteria)) {
  2190. $this->collKataoOrders = KataoOrderPeer::doSelectJoinKataoPeriod($criteria, $con);
  2191. }
  2192. }
  2193. $this->lastKataoOrderCriteria = $criteria;
  2194. return $this->collKataoOrders;
  2195. }
  2196. /**
  2197. * Temporary storage of collKataoInvoices to save a possible db hit in
  2198. * the event objects are add to the collection, but the
  2199. * complete collection is never requested.
  2200. * @return void
  2201. */
  2202. public function initKataoInvoices()
  2203. {
  2204. if ($this->collKataoInvoices === null) {
  2205. $this->collKataoInvoices = array();
  2206. }
  2207. }
  2208. /**
  2209. * If this collection has already been initialized with
  2210. * an identical criteria, it returns the collection.
  2211. * Otherwise if this KataoNode has previously
  2212. * been saved, it will retrieve related KataoInvoices from storage.
  2213. * If this KataoNode is new, it will return
  2214. * an empty collection or the current collection, the criteria
  2215. * is ignored on a new object.
  2216. *
  2217. * @param Connection $con
  2218. * @param Criteria $criteria
  2219. * @throws PropelException
  2220. */
  2221. public function getKataoInvoices($criteria = null, $con = null)
  2222. {
  2223. // include the Peer class
  2224. if ($criteria === null) {
  2225. $criteria = new Criteria();
  2226. }
  2227. elseif ($criteria instanceof Criteria)
  2228. {
  2229. $criteria = clone $criteria;
  2230. }
  2231. if ($this->collKataoInvoices === null) {
  2232. if ($this->isNew()) {
  2233. $this->collKataoInvoices = array();
  2234. } else {
  2235. $criteria->add(KataoInvoicePeer::KATAO_NODE_ID, $this->getId());
  2236. KataoInvoicePeer::addSelectColumns($criteria);
  2237. $this->collKataoInvoices = KataoInvoicePeer::doSelect($criteria, $con);
  2238. }
  2239. } else {
  2240. // criteria has no effect for a new object
  2241. if (!$this->isNew()) {
  2242. // the following code is to determine if a new query is
  2243. // called for. If the criteria is the same as the last
  2244. // one, just return the collection.
  2245. $criteria->add(KataoInvoicePeer::KATAO_NODE_ID, $this->getId());
  2246. KataoInvoicePeer::addSelectColumns($criteria);
  2247. if (!isset($this->lastKataoInvoiceCriteria) || !$this->lastKataoInvoiceCriteria->equals($criteria)) {
  2248. $this->collKataoInvoices = KataoInvoicePeer::doSelect($criteria, $con);
  2249. }
  2250. }
  2251. }
  2252. $this->lastKataoInvoiceCriteria = $criteria;
  2253. return $this->collKataoInvoices;
  2254. }
  2255. /**
  2256. * Returns the number of related KataoInvoices.
  2257. *
  2258. * @param Criteria $criteria
  2259. * @param boolean $distinct
  2260. * @param Connection $con
  2261. * @throws PropelException
  2262. */
  2263. public function countKataoInvoices($criteria = null, $distinct = false, $con = null)
  2264. {
  2265. // include the Peer class
  2266. if ($criteria === null) {
  2267. $criteria = new Criteria();
  2268. }
  2269. elseif ($criteria instanceof Criteria)
  2270. {
  2271. $criteria = clone $criteria;
  2272. }
  2273. $criteria->add(KataoInvoicePeer::KATAO_NODE_ID, $this->getId());
  2274. return KataoInvoicePeer::doCount($criteria, $distinct, $con);
  2275. }
  2276. /**
  2277. * Method called to associate a KataoInvoice object to this object
  2278. * through the KataoInvoice foreign key attribute
  2279. *
  2280. * @param KataoInvoice $l KataoInvoice
  2281. * @return void
  2282. * @throws PropelException
  2283. */
  2284. public function addKataoInvoice(KataoInvoice $l)
  2285. {
  2286. $this->collKataoInvoices[] = $l;
  2287. $l->setKataoNode($this);
  2288. }
  2289. /**
  2290. * If this collection has already been initialized with
  2291. * an identical criteria, it returns the collection.
  2292. * Otherwise if this KataoNode is new, it will return
  2293. * an empty collection; or if this KataoNode has previously
  2294. * been saved, it will retrieve related KataoInvoices from storage.
  2295. *
  2296. * This method is protected by default in order to keep the public
  2297. * api reasonable. You can provide public methods for those you
  2298. * actually need in KataoNode.
  2299. */
  2300. public function getKataoInvoicesJoinKataoMember($criteria = null, $con = null)
  2301. {
  2302. // include the Peer class
  2303. if ($criteria === null) {
  2304. $criteria = new Criteria();
  2305. }
  2306. elseif ($criteria instanceof Criteria)
  2307. {
  2308. $criteria = clone $criteria;
  2309. }
  2310. if ($this->collKataoInvoices === null) {
  2311. if ($this->isNew()) {
  2312. $this->collKataoInvoices = array();
  2313. } else {
  2314. $criteria->add(KataoInvoicePeer::KATAO_NODE_ID, $this->getId());
  2315. $this->collKataoInvoices = KataoInvoicePeer::doSelectJoinKataoMember($criteria, $con);
  2316. }
  2317. } else {
  2318. // the following code is to determine if a new query is
  2319. // called for. If the criteria is the same as the last
  2320. // one, just return the collection.
  2321. $criteria->add(KataoInvoicePeer::KATAO_NODE_ID, $this->getId());
  2322. if (!isset($this->lastKataoInvoiceCriteria) || !$this->lastKataoInvoiceCriteria->equals($criteria)) {
  2323. $this->collKataoInvoices = KataoInvoicePeer::doSelectJoinKataoMember($criteria, $con);
  2324. }
  2325. }
  2326. $this->lastKataoInvoiceCriteria = $criteria;
  2327. return $this->collKataoInvoices;
  2328. }
  2329. /**
  2330. * If this collection has already been initialized with
  2331. * an identical criteria, it returns the collection.
  2332. * Otherwise if this KataoNode is new, it will return
  2333. * an empty collection; or if this KataoNode has previously
  2334. * been saved, it will retrieve related KataoInvoices from storage.
  2335. *
  2336. * This method is protected by default in order to keep the public
  2337. * api reasonable. You can provide public methods for those you
  2338. * actually need in KataoNode.
  2339. */
  2340. public function getKataoInvoicesJoinKataoPeriod($criteria = null, $con = null)
  2341. {
  2342. // include the Peer class
  2343. if ($criteria === null) {
  2344. $criteria = new Criteria();
  2345. }
  2346. elseif ($criteria instanceof Criteria)
  2347. {
  2348. $criteria = clone $criteria;
  2349. }
  2350. if ($this->collKataoInvoices === null) {
  2351. if ($this->isNew()) {
  2352. $this->collKataoInvoices = array();
  2353. } else {
  2354. $criteria->add(KataoInvoicePeer::KATAO_NODE_ID, $this->getId());
  2355. $this->collKataoInvoices = KataoInvoicePeer::doSelectJoinKataoPeriod($criteria, $con);
  2356. }
  2357. } else {
  2358. // the following code is to determine if a new query is
  2359. // called for. If the criteria is the same as the last
  2360. // one, just return the collection.
  2361. $criteria->add(KataoInvoicePeer::KATAO_NODE_ID, $this->getId());
  2362. if (!isset($this->lastKataoInvoiceCriteria) || !$this->lastKataoInvoiceCriteria->equals($criteria)) {
  2363. $this->collKataoInvoices = KataoInvoicePeer::doSelectJoinKataoPeriod($criteria, $con);
  2364. }
  2365. }
  2366. $this->lastKataoInvoiceCriteria = $criteria;
  2367. return $this->collKataoInvoices;
  2368. }
  2369. /**
  2370. * If this collection has already been initialized with
  2371. * an identical criteria, it returns the collection.
  2372. * Otherwise if this KataoNode is new, it will return
  2373. * an empty collection; or if this KataoNode has previously
  2374. * been saved, it will retrieve related KataoInvoices from storage.
  2375. *
  2376. * This method is protected by default in order to keep the public
  2377. * api reasonable. You can provide public methods for those you
  2378. * actually need in KataoNode.
  2379. */
  2380. public function getKataoInvoicesJoinKataoCart($criteria = null, $con = null)
  2381. {
  2382. // include the Peer class
  2383. if ($criteria === null) {
  2384. $criteria = new Criteria();
  2385. }
  2386. elseif ($criteria instanceof Criteria)
  2387. {
  2388. $criteria = clone $criteria;
  2389. }
  2390. if ($this->collKataoInvoices === null) {
  2391. if ($this->isNew()) {
  2392. $this->collKataoInvoices = array();
  2393. } else {
  2394. $criteria->add(KataoInvoicePeer::KATAO_NODE_ID, $this->getId());
  2395. $this->collKataoInvoices = KataoInvoicePeer::doSelectJoinKataoCart($criteria, $con);
  2396. }
  2397. } else {
  2398. // the following code is to determine if a new query is
  2399. // called for. If the criteria is the same as the last
  2400. // one, just return the collection.
  2401. $criteria->add(KataoInvoicePeer::KATAO_NODE_ID, $this->getId());
  2402. if (!isset($this->lastKataoInvoiceCriteria) || !$this->lastKataoInvoiceCriteria->equals($criteria)) {
  2403. $this->collKataoInvoices = KataoInvoicePeer::doSelectJoinKataoCart($criteria, $con);
  2404. }
  2405. }
  2406. $this->lastKataoInvoiceCriteria = $criteria;
  2407. return $this->collKataoInvoices;
  2408. }
  2409. /**
  2410. * Temporary storage of collKataoMemberNodes to save a possible db hit in
  2411. * the event objects are add to the collection, but the
  2412. * complete collection is never requested.
  2413. * @return void
  2414. */
  2415. public function initKataoMemberNodes()
  2416. {
  2417. if ($this->collKataoMemberNodes === null) {
  2418. $this->collKataoMemberNodes = array();
  2419. }
  2420. }
  2421. /**
  2422. * If this collection has already been initialized with
  2423. * an identical criteria, it returns the collection.
  2424. * Otherwise if this KataoNode has previously
  2425. * been saved, it will retrieve related KataoMemberNodes from storage.
  2426. * If this KataoNode is new, it will return
  2427. * an empty collection or the current collection, the criteria
  2428. * is ignored on a new object.
  2429. *
  2430. * @param Connection $con
  2431. * @param Criteria $criteria
  2432. * @throws PropelException
  2433. */
  2434. public function getKataoMemberNodes($criteria = null, $con = null)
  2435. {
  2436. // include the Peer class
  2437. if ($criteria === null) {
  2438. $criteria = new Criteria();
  2439. }
  2440. elseif ($criteria instanceof Criteria)
  2441. {
  2442. $criteria = clone $criteria;
  2443. }
  2444. if ($this->collKataoMemberNodes === null) {
  2445. if ($this->isNew()) {
  2446. $this->collKataoMemberNodes = array();
  2447. } else {
  2448. $criteria->add(KataoMemberNodePeer::KATAO_NODE_ID, $this->getId());
  2449. KataoMemberNodePeer::addSelectColumns($criteria);
  2450. $this->collKataoMemberNodes = KataoMemberNodePeer::doSelect($criteria, $con);
  2451. }
  2452. } else {
  2453. // criteria has no effect for a new object
  2454. if (!$this->isNew()) {
  2455. // the following code is to determine if a new query is
  2456. // called for. If the criteria is the same as the last
  2457. // one, just return the collection.
  2458. $criteria->add(KataoMemberNodePeer::KATAO_NODE_ID, $this->getId());
  2459. KataoMemberNodePeer::addSelectColumns($criteria);
  2460. if (!isset($this->lastKataoMemberNodeCriteria) || !$this->lastKataoMemberNodeCriteria->equals($criteria)) {
  2461. $this->collKataoMemberNodes = KataoMemberNodePeer::doSelect($criteria, $con);
  2462. }
  2463. }
  2464. }
  2465. $this->lastKataoMemberNodeCriteria = $criteria;
  2466. return $this->collKataoMemberNodes;
  2467. }
  2468. /**
  2469. * Returns the number of related KataoMemberNodes.
  2470. *
  2471. * @param Criteria $criteria
  2472. * @param boolean $distinct
  2473. * @param Connection $con
  2474. * @throws PropelException
  2475. */
  2476. public function countKataoMemberNodes($criteria = null, $distinct = false, $con = null)
  2477. {
  2478. // include the Peer class
  2479. if ($criteria === null) {
  2480. $criteria = new Criteria();
  2481. }
  2482. elseif ($criteria instanceof Criteria)
  2483. {
  2484. $criteria = clone $criteria;
  2485. }
  2486. $criteria->add(KataoMemberNodePeer::KATAO_NODE_ID, $this->getId());
  2487. return KataoMemberNodePeer::doCount($criteria, $distinct, $con);
  2488. }
  2489. /**
  2490. * Method called to associate a KataoMemberNode object to this object
  2491. * through the KataoMemberNode foreign key attribute
  2492. *
  2493. * @param KataoMemberNode $l KataoMemberNode
  2494. * @return void
  2495. * @throws PropelException
  2496. */
  2497. public function addKataoMemberNode(KataoMemberNode $l)
  2498. {
  2499. $this->collKataoMemberNodes[] = $l;
  2500. $l->setKataoNode($this);
  2501. }
  2502. /**
  2503. * If this collection has already been initialized with
  2504. * an identical criteria, it returns the collection.
  2505. * Otherwise if this KataoNode is new, it will return
  2506. * an empty collection; or if this KataoNode has previously
  2507. * been saved, it will retrieve related KataoMemberNodes from storage.
  2508. *
  2509. * This method is protected by default in order to keep the public
  2510. * api reasonable. You can provide public methods for those you
  2511. * actually need in KataoNode.
  2512. */
  2513. public function getKataoMemberNodesJoinKataoMember($criteria = null, $con = null)
  2514. {
  2515. // include the Peer class
  2516. if ($criteria === null) {
  2517. $criteria = new Criteria();
  2518. }
  2519. elseif ($criteria instanceof Criteria)
  2520. {
  2521. $criteria = clone $criteria;
  2522. }
  2523. if ($this->collKataoMemberNodes === null) {
  2524. if ($this->isNew()) {
  2525. $this->collKataoMemberNodes = array();
  2526. } else {
  2527. $criteria->add(KataoMemberNodePeer::KATAO_NODE_ID, $this->getId());
  2528. $this->collKataoMemberNodes = KataoMemberNodePeer::doSelectJoinKataoMember($criteria, $con);
  2529. }
  2530. } else {
  2531. // the following code is to determine if a new query is
  2532. // called for. If the criteria is the same as the last
  2533. // one, just return the collection.
  2534. $criteria->add(KataoMemberNodePeer::KATAO_NODE_ID, $this->getId());
  2535. if (!isset($this->lastKataoMemberNodeCriteria) || !$this->lastKataoMemberNodeCriteria->equals($criteria)) {
  2536. $this->collKataoMemberNodes = KataoMemberNodePeer::doSelectJoinKataoMember($criteria, $con);
  2537. }
  2538. }
  2539. $this->lastKataoMemberNodeCriteria = $criteria;
  2540. return $this->collKataoMemberNodes;
  2541. }
  2542. public function __call($method, $arguments)
  2543. {
  2544. if (!$callable = sfMixer::getCallable('BaseKataoNode:'.$method))
  2545. {
  2546. throw new sfException(sprintf('Call to undefined method BaseKataoNode::%s', $method));
  2547. }
  2548. array_unshift($arguments, $this);
  2549. return call_user_func_array($callable, $arguments);
  2550. }
  2551. } // BaseKataoNode