BaseKataoPeriod.php 82 KB

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