BaseKataoOrder.php 58 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354355356357358359360361362363364365366367368369370371372373374375376377378379380381382383384385386387388389390391392393394395396397398399400401402403404405406407408409410411412413414415416417418419420421422423424425426427428429430431432433434435436437438439440441442443444445446447448449450451452453454455456457458459460461462463464465466467468469470471472473474475476477478479480481482483484485486487488489490491492493494495496497498499500501502503504505506507508509510511512513514515516517518519520521522523524525526527528529530531532533534535536537538539540541542543544545546547548549550551552553554555556557558559560561562563564565566567568569570571572573574575576577578579580581582583584585586587588589590591592593594595596597598599600601602603604605606607608609610611612613614615616617618619620621622623624625626627628629630631632633634635636637638639640641642643644645646647648649650651652653654655656657658659660661662663664665666667668669670671672673674675676677678679680681682683684685686687688689690691692693694695696697698699700701702703704705706707708709710711712713714715716717718719720721722723724725726727728729730731732733734735736737738739740741742743744745746747748749750751752753754755756757758759760761762763764765766767768769770771772773774775776777778779780781782783784785786787788789790791792793794795796797798799800801802803804805806807808809810811812813814815816817818819820821822823824825826827828829830831832833834835836837838839840841842843844845846847848849850851852853854855856857858859860861862863864865866867868869870871872873874875876877878879880881882883884885886887888889890891892893894895896897898899900901902903904905906907908909910911912913914915916917918919920921922923924925926927928929930931932933934935936937938939940941942943944945946947948949950951952953954955956957958959960961962963964965966967968969970971972973974975976977978979980981982983984985986987988989990991992993994995996997998999100010011002100310041005100610071008100910101011101210131014101510161017101810191020102110221023102410251026102710281029103010311032103310341035103610371038103910401041104210431044104510461047104810491050105110521053105410551056105710581059106010611062106310641065106610671068106910701071107210731074107510761077107810791080108110821083108410851086108710881089109010911092109310941095109610971098109911001101110211031104110511061107110811091110111111121113111411151116111711181119112011211122112311241125112611271128112911301131113211331134113511361137113811391140114111421143114411451146114711481149115011511152115311541155115611571158115911601161116211631164116511661167116811691170117111721173117411751176117711781179118011811182118311841185118611871188118911901191119211931194119511961197119811991200120112021203120412051206120712081209121012111212121312141215121612171218121912201221122212231224122512261227122812291230123112321233123412351236123712381239124012411242124312441245124612471248124912501251125212531254125512561257125812591260126112621263126412651266126712681269127012711272127312741275127612771278127912801281128212831284128512861287128812891290129112921293129412951296129712981299130013011302130313041305130613071308130913101311131213131314131513161317131813191320132113221323132413251326132713281329133013311332133313341335133613371338133913401341134213431344134513461347134813491350135113521353135413551356135713581359136013611362136313641365136613671368136913701371137213731374137513761377137813791380138113821383138413851386138713881389139013911392139313941395139613971398139914001401140214031404140514061407140814091410141114121413141414151416141714181419142014211422142314241425142614271428142914301431143214331434143514361437143814391440144114421443144414451446144714481449145014511452145314541455145614571458145914601461146214631464146514661467146814691470147114721473147414751476147714781479148014811482148314841485148614871488148914901491149214931494149514961497149814991500150115021503150415051506150715081509151015111512151315141515151615171518151915201521152215231524152515261527152815291530153115321533153415351536153715381539154015411542154315441545154615471548154915501551155215531554155515561557155815591560156115621563156415651566156715681569157015711572157315741575157615771578157915801581158215831584158515861587158815891590159115921593159415951596159715981599160016011602160316041605160616071608160916101611161216131614161516161617161816191620162116221623162416251626162716281629163016311632163316341635163616371638163916401641164216431644164516461647164816491650165116521653165416551656165716581659166016611662166316641665166616671668166916701671167216731674167516761677167816791680168116821683168416851686168716881689169016911692169316941695169616971698169917001701170217031704170517061707170817091710171117121713171417151716171717181719172017211722172317241725172617271728172917301731173217331734173517361737173817391740174117421743174417451746174717481749175017511752175317541755175617571758175917601761176217631764176517661767176817691770177117721773177417751776177717781779178017811782178317841785178617871788178917901791179217931794179517961797179817991800180118021803180418051806180718081809181018111812181318141815181618171818181918201821182218231824182518261827182818291830183118321833183418351836183718381839184018411842184318441845184618471848184918501851185218531854185518561857185818591860186118621863186418651866186718681869187018711872187318741875187618771878187918801881188218831884188518861887188818891890189118921893189418951896189718981899190019011902190319041905190619071908190919101911191219131914191519161917191819191920192119221923192419251926192719281929193019311932193319341935193619371938193919401941194219431944194519461947194819491950195119521953195419551956195719581959196019611962196319641965196619671968196919701971197219731974197519761977197819791980198119821983198419851986198719881989199019911992199319941995199619971998199920002001200220032004200520062007200820092010201120122013201420152016201720182019202020212022202320242025202620272028202920302031203220332034203520362037203820392040204120422043204420452046204720482049205020512052205320542055205620572058205920602061206220632064206520662067206820692070207120722073207420752076207720782079208020812082208320842085208620872088208920902091209220932094209520962097209820992100210121022103210421052106210721082109211021112112211321142115211621172118211921202121212221232124212521262127212821292130213121322133213421352136213721382139214021412142214321442145214621472148214921502151215221532154215521562157215821592160216121622163216421652166216721682169217021712172217321742175217621772178217921802181218221832184218521862187218821892190219121922193219421952196219721982199220022012202220322042205
  1. <?php
  2. /**
  3. * Base class that represents a row from the 'katao_order' table.
  4. *
  5. *
  6. *
  7. * @package lib.model.om
  8. */
  9. abstract class BaseKataoOrder 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 KataoOrderPeer
  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 katao_supplier_id field.
  24. * @var int
  25. */
  26. protected $katao_supplier_id;
  27. /**
  28. * The value for the katao_period_id field.
  29. * @var int
  30. */
  31. protected $katao_period_id;
  32. /**
  33. * The value for the katao_node_id field.
  34. * @var int
  35. */
  36. protected $katao_node_id;
  37. /**
  38. * The value for the status field.
  39. * @var int
  40. */
  41. protected $status = 1;
  42. /**
  43. * The value for the is_simulated field.
  44. * @var int
  45. */
  46. protected $is_simulated = 0;
  47. /**
  48. * The value for the supplier_name field.
  49. * @var string
  50. */
  51. protected $supplier_name;
  52. /**
  53. * The value for the supplier_email field.
  54. * @var string
  55. */
  56. protected $supplier_email;
  57. /**
  58. * The value for the supplier_address1 field.
  59. * @var string
  60. */
  61. protected $supplier_address1;
  62. /**
  63. * The value for the supplier_address2 field.
  64. * @var string
  65. */
  66. protected $supplier_address2;
  67. /**
  68. * The value for the supplier_zip field.
  69. * @var string
  70. */
  71. protected $supplier_zip;
  72. /**
  73. * The value for the supplier_city field.
  74. * @var string
  75. */
  76. protected $supplier_city;
  77. /**
  78. * The value for the katao_name field.
  79. * @var string
  80. */
  81. protected $katao_name;
  82. /**
  83. * The value for the katao_address field.
  84. * @var string
  85. */
  86. protected $katao_address;
  87. /**
  88. * The value for the katao_siret_number field.
  89. * @var string
  90. */
  91. protected $katao_siret_number;
  92. /**
  93. * The value for the katao_rcs_number field.
  94. * @var string
  95. */
  96. protected $katao_rcs_number;
  97. /**
  98. * The value for the katao_capital field.
  99. * @var int
  100. */
  101. protected $katao_capital;
  102. /**
  103. * The value for the delivery_address field.
  104. * @var string
  105. */
  106. protected $delivery_address;
  107. /**
  108. * The value for the created_at field.
  109. * @var int
  110. */
  111. protected $created_at;
  112. /**
  113. * The value for the updated_at field.
  114. * @var int
  115. */
  116. protected $updated_at;
  117. /**
  118. * @var KataoSupplier
  119. */
  120. protected $aKataoSupplier;
  121. /**
  122. * @var KataoPeriod
  123. */
  124. protected $aKataoPeriod;
  125. /**
  126. * @var KataoNode
  127. */
  128. protected $aKataoNode;
  129. /**
  130. * Collection to store aggregation of collKataoOrderProducts.
  131. * @var array
  132. */
  133. protected $collKataoOrderProducts;
  134. /**
  135. * The criteria used to select the current contents of collKataoOrderProducts.
  136. * @var Criteria
  137. */
  138. protected $lastKataoOrderProductCriteria = null;
  139. /**
  140. * Collection to store aggregation of collKataoSupplierInvoiceOrders.
  141. * @var array
  142. */
  143. protected $collKataoSupplierInvoiceOrders;
  144. /**
  145. * The criteria used to select the current contents of collKataoSupplierInvoiceOrders.
  146. * @var Criteria
  147. */
  148. protected $lastKataoSupplierInvoiceOrderCriteria = null;
  149. /**
  150. * Flag to prevent endless save loop, if this object is referenced
  151. * by another object which falls in this transaction.
  152. * @var boolean
  153. */
  154. protected $alreadyInSave = false;
  155. /**
  156. * Flag to prevent endless validation loop, if this object is referenced
  157. * by another object which falls in this transaction.
  158. * @var boolean
  159. */
  160. protected $alreadyInValidation = false;
  161. /**
  162. * Get the [id] column value.
  163. *
  164. * @return int
  165. */
  166. public function getId()
  167. {
  168. return $this->id;
  169. }
  170. /**
  171. * Get the [katao_supplier_id] column value.
  172. *
  173. * @return int
  174. */
  175. public function getKataoSupplierId()
  176. {
  177. return $this->katao_supplier_id;
  178. }
  179. /**
  180. * Get the [katao_period_id] column value.
  181. *
  182. * @return int
  183. */
  184. public function getKataoPeriodId()
  185. {
  186. return $this->katao_period_id;
  187. }
  188. /**
  189. * Get the [katao_node_id] column value.
  190. *
  191. * @return int
  192. */
  193. public function getKataoNodeId()
  194. {
  195. return $this->katao_node_id;
  196. }
  197. /**
  198. * Get the [status] column value.
  199. *
  200. * @return int
  201. */
  202. public function getStatus()
  203. {
  204. return $this->status;
  205. }
  206. /**
  207. * Get the [is_simulated] column value.
  208. *
  209. * @return int
  210. */
  211. public function getIsSimulated()
  212. {
  213. return $this->is_simulated;
  214. }
  215. /**
  216. * Get the [supplier_name] column value.
  217. *
  218. * @return string
  219. */
  220. public function getSupplierName()
  221. {
  222. return $this->supplier_name;
  223. }
  224. /**
  225. * Get the [supplier_email] column value.
  226. *
  227. * @return string
  228. */
  229. public function getSupplierEmail()
  230. {
  231. return $this->supplier_email;
  232. }
  233. /**
  234. * Get the [supplier_address1] column value.
  235. *
  236. * @return string
  237. */
  238. public function getSupplierAddress1()
  239. {
  240. return $this->supplier_address1;
  241. }
  242. /**
  243. * Get the [supplier_address2] column value.
  244. *
  245. * @return string
  246. */
  247. public function getSupplierAddress2()
  248. {
  249. return $this->supplier_address2;
  250. }
  251. /**
  252. * Get the [supplier_zip] column value.
  253. *
  254. * @return string
  255. */
  256. public function getSupplierZip()
  257. {
  258. return $this->supplier_zip;
  259. }
  260. /**
  261. * Get the [supplier_city] column value.
  262. *
  263. * @return string
  264. */
  265. public function getSupplierCity()
  266. {
  267. return $this->supplier_city;
  268. }
  269. /**
  270. * Get the [katao_name] column value.
  271. *
  272. * @return string
  273. */
  274. public function getKataoName()
  275. {
  276. return $this->katao_name;
  277. }
  278. /**
  279. * Get the [katao_address] column value.
  280. *
  281. * @return string
  282. */
  283. public function getKataoAddress()
  284. {
  285. return $this->katao_address;
  286. }
  287. /**
  288. * Get the [katao_siret_number] column value.
  289. *
  290. * @return string
  291. */
  292. public function getKataoSiretNumber()
  293. {
  294. return $this->katao_siret_number;
  295. }
  296. /**
  297. * Get the [katao_rcs_number] column value.
  298. *
  299. * @return string
  300. */
  301. public function getKataoRcsNumber()
  302. {
  303. return $this->katao_rcs_number;
  304. }
  305. /**
  306. * Get the [katao_capital] column value.
  307. *
  308. * @return int
  309. */
  310. public function getKataoCapital()
  311. {
  312. return $this->katao_capital;
  313. }
  314. /**
  315. * Get the [delivery_address] column value.
  316. *
  317. * @return string
  318. */
  319. public function getDeliveryAddress()
  320. {
  321. return $this->delivery_address;
  322. }
  323. /**
  324. * Get the [optionally formatted] [created_at] column value.
  325. *
  326. * @param string $format The date/time format string (either date()-style or strftime()-style).
  327. * If format is NULL, then the integer unix timestamp will be returned.
  328. * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
  329. * @throws PropelException - if unable to convert the date/time to timestamp.
  330. */
  331. public function getCreatedAt($format = 'Y-m-d H:i:s')
  332. {
  333. if ($this->created_at === null || $this->created_at === '') {
  334. return null;
  335. } elseif (!is_int($this->created_at)) {
  336. // a non-timestamp value was set externally, so we convert it
  337. $ts = strtotime($this->created_at);
  338. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  339. throw new PropelException("Unable to parse value of [created_at] as date/time value: " . var_export($this->created_at, true));
  340. }
  341. } else {
  342. $ts = $this->created_at;
  343. }
  344. if ($format === null) {
  345. return $ts;
  346. } elseif (strpos($format, '%') !== false) {
  347. return strftime($format, $ts);
  348. } else {
  349. return date($format, $ts);
  350. }
  351. }
  352. /**
  353. * Get the [optionally formatted] [updated_at] column value.
  354. *
  355. * @param string $format The date/time format string (either date()-style or strftime()-style).
  356. * If format is NULL, then the integer unix timestamp will be returned.
  357. * @return mixed Formatted date/time value as string or integer unix timestamp (if format is NULL).
  358. * @throws PropelException - if unable to convert the date/time to timestamp.
  359. */
  360. public function getUpdatedAt($format = 'Y-m-d H:i:s')
  361. {
  362. if ($this->updated_at === null || $this->updated_at === '') {
  363. return null;
  364. } elseif (!is_int($this->updated_at)) {
  365. // a non-timestamp value was set externally, so we convert it
  366. $ts = strtotime($this->updated_at);
  367. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  368. throw new PropelException("Unable to parse value of [updated_at] as date/time value: " . var_export($this->updated_at, true));
  369. }
  370. } else {
  371. $ts = $this->updated_at;
  372. }
  373. if ($format === null) {
  374. return $ts;
  375. } elseif (strpos($format, '%') !== false) {
  376. return strftime($format, $ts);
  377. } else {
  378. return date($format, $ts);
  379. }
  380. }
  381. /**
  382. * Set the value of [id] column.
  383. *
  384. * @param int $v new value
  385. * @return void
  386. */
  387. public function setId($v)
  388. {
  389. // Since the native PHP type for this column is integer,
  390. // we will cast the input value to an int (if it is not).
  391. if ($v !== null && !is_int($v) && is_numeric($v)) {
  392. $v = (int) $v;
  393. }
  394. if ($this->id !== $v) {
  395. $this->id = $v;
  396. $this->modifiedColumns[] = KataoOrderPeer::ID;
  397. }
  398. } // setId()
  399. /**
  400. * Set the value of [katao_supplier_id] column.
  401. *
  402. * @param int $v new value
  403. * @return void
  404. */
  405. public function setKataoSupplierId($v)
  406. {
  407. // Since the native PHP type for this column is integer,
  408. // we will cast the input value to an int (if it is not).
  409. if ($v !== null && !is_int($v) && is_numeric($v)) {
  410. $v = (int) $v;
  411. }
  412. if ($this->katao_supplier_id !== $v) {
  413. $this->katao_supplier_id = $v;
  414. $this->modifiedColumns[] = KataoOrderPeer::KATAO_SUPPLIER_ID;
  415. }
  416. if ($this->aKataoSupplier !== null && $this->aKataoSupplier->getId() !== $v) {
  417. $this->aKataoSupplier = null;
  418. }
  419. } // setKataoSupplierId()
  420. /**
  421. * Set the value of [katao_period_id] column.
  422. *
  423. * @param int $v new value
  424. * @return void
  425. */
  426. public function setKataoPeriodId($v)
  427. {
  428. // Since the native PHP type for this column is integer,
  429. // we will cast the input value to an int (if it is not).
  430. if ($v !== null && !is_int($v) && is_numeric($v)) {
  431. $v = (int) $v;
  432. }
  433. if ($this->katao_period_id !== $v) {
  434. $this->katao_period_id = $v;
  435. $this->modifiedColumns[] = KataoOrderPeer::KATAO_PERIOD_ID;
  436. }
  437. if ($this->aKataoPeriod !== null && $this->aKataoPeriod->getId() !== $v) {
  438. $this->aKataoPeriod = null;
  439. }
  440. } // setKataoPeriodId()
  441. /**
  442. * Set the value of [katao_node_id] column.
  443. *
  444. * @param int $v new value
  445. * @return void
  446. */
  447. public function setKataoNodeId($v)
  448. {
  449. // Since the native PHP type for this column is integer,
  450. // we will cast the input value to an int (if it is not).
  451. if ($v !== null && !is_int($v) && is_numeric($v)) {
  452. $v = (int) $v;
  453. }
  454. if ($this->katao_node_id !== $v) {
  455. $this->katao_node_id = $v;
  456. $this->modifiedColumns[] = KataoOrderPeer::KATAO_NODE_ID;
  457. }
  458. if ($this->aKataoNode !== null && $this->aKataoNode->getId() !== $v) {
  459. $this->aKataoNode = null;
  460. }
  461. } // setKataoNodeId()
  462. /**
  463. * Set the value of [status] column.
  464. *
  465. * @param int $v new value
  466. * @return void
  467. */
  468. public function setStatus($v)
  469. {
  470. // Since the native PHP type for this column is integer,
  471. // we will cast the input value to an int (if it is not).
  472. if ($v !== null && !is_int($v) && is_numeric($v)) {
  473. $v = (int) $v;
  474. }
  475. if ($this->status !== $v || $v === 1) {
  476. $this->status = $v;
  477. $this->modifiedColumns[] = KataoOrderPeer::STATUS;
  478. }
  479. } // setStatus()
  480. /**
  481. * Set the value of [is_simulated] column.
  482. *
  483. * @param int $v new value
  484. * @return void
  485. */
  486. public function setIsSimulated($v)
  487. {
  488. // Since the native PHP type for this column is integer,
  489. // we will cast the input value to an int (if it is not).
  490. if ($v !== null && !is_int($v) && is_numeric($v)) {
  491. $v = (int) $v;
  492. }
  493. if ($this->is_simulated !== $v || $v === 0) {
  494. $this->is_simulated = $v;
  495. $this->modifiedColumns[] = KataoOrderPeer::IS_SIMULATED;
  496. }
  497. } // setIsSimulated()
  498. /**
  499. * Set the value of [supplier_name] column.
  500. *
  501. * @param string $v new value
  502. * @return void
  503. */
  504. public function setSupplierName($v)
  505. {
  506. // Since the native PHP type for this column is string,
  507. // we will cast the input to a string (if it is not).
  508. if ($v !== null && !is_string($v)) {
  509. $v = (string) $v;
  510. }
  511. if ($this->supplier_name !== $v) {
  512. $this->supplier_name = $v;
  513. $this->modifiedColumns[] = KataoOrderPeer::SUPPLIER_NAME;
  514. }
  515. } // setSupplierName()
  516. /**
  517. * Set the value of [supplier_email] column.
  518. *
  519. * @param string $v new value
  520. * @return void
  521. */
  522. public function setSupplierEmail($v)
  523. {
  524. // Since the native PHP type for this column is string,
  525. // we will cast the input to a string (if it is not).
  526. if ($v !== null && !is_string($v)) {
  527. $v = (string) $v;
  528. }
  529. if ($this->supplier_email !== $v) {
  530. $this->supplier_email = $v;
  531. $this->modifiedColumns[] = KataoOrderPeer::SUPPLIER_EMAIL;
  532. }
  533. } // setSupplierEmail()
  534. /**
  535. * Set the value of [supplier_address1] column.
  536. *
  537. * @param string $v new value
  538. * @return void
  539. */
  540. public function setSupplierAddress1($v)
  541. {
  542. // Since the native PHP type for this column is string,
  543. // we will cast the input to a string (if it is not).
  544. if ($v !== null && !is_string($v)) {
  545. $v = (string) $v;
  546. }
  547. if ($this->supplier_address1 !== $v) {
  548. $this->supplier_address1 = $v;
  549. $this->modifiedColumns[] = KataoOrderPeer::SUPPLIER_ADDRESS1;
  550. }
  551. } // setSupplierAddress1()
  552. /**
  553. * Set the value of [supplier_address2] column.
  554. *
  555. * @param string $v new value
  556. * @return void
  557. */
  558. public function setSupplierAddress2($v)
  559. {
  560. // Since the native PHP type for this column is string,
  561. // we will cast the input to a string (if it is not).
  562. if ($v !== null && !is_string($v)) {
  563. $v = (string) $v;
  564. }
  565. if ($this->supplier_address2 !== $v) {
  566. $this->supplier_address2 = $v;
  567. $this->modifiedColumns[] = KataoOrderPeer::SUPPLIER_ADDRESS2;
  568. }
  569. } // setSupplierAddress2()
  570. /**
  571. * Set the value of [supplier_zip] column.
  572. *
  573. * @param string $v new value
  574. * @return void
  575. */
  576. public function setSupplierZip($v)
  577. {
  578. // Since the native PHP type for this column is string,
  579. // we will cast the input to a string (if it is not).
  580. if ($v !== null && !is_string($v)) {
  581. $v = (string) $v;
  582. }
  583. if ($this->supplier_zip !== $v) {
  584. $this->supplier_zip = $v;
  585. $this->modifiedColumns[] = KataoOrderPeer::SUPPLIER_ZIP;
  586. }
  587. } // setSupplierZip()
  588. /**
  589. * Set the value of [supplier_city] column.
  590. *
  591. * @param string $v new value
  592. * @return void
  593. */
  594. public function setSupplierCity($v)
  595. {
  596. // Since the native PHP type for this column is string,
  597. // we will cast the input to a string (if it is not).
  598. if ($v !== null && !is_string($v)) {
  599. $v = (string) $v;
  600. }
  601. if ($this->supplier_city !== $v) {
  602. $this->supplier_city = $v;
  603. $this->modifiedColumns[] = KataoOrderPeer::SUPPLIER_CITY;
  604. }
  605. } // setSupplierCity()
  606. /**
  607. * Set the value of [katao_name] column.
  608. *
  609. * @param string $v new value
  610. * @return void
  611. */
  612. public function setKataoName($v)
  613. {
  614. // Since the native PHP type for this column is string,
  615. // we will cast the input to a string (if it is not).
  616. if ($v !== null && !is_string($v)) {
  617. $v = (string) $v;
  618. }
  619. if ($this->katao_name !== $v) {
  620. $this->katao_name = $v;
  621. $this->modifiedColumns[] = KataoOrderPeer::KATAO_NAME;
  622. }
  623. } // setKataoName()
  624. /**
  625. * Set the value of [katao_address] column.
  626. *
  627. * @param string $v new value
  628. * @return void
  629. */
  630. public function setKataoAddress($v)
  631. {
  632. // Since the native PHP type for this column is string,
  633. // we will cast the input to a string (if it is not).
  634. if ($v !== null && !is_string($v)) {
  635. $v = (string) $v;
  636. }
  637. if ($this->katao_address !== $v) {
  638. $this->katao_address = $v;
  639. $this->modifiedColumns[] = KataoOrderPeer::KATAO_ADDRESS;
  640. }
  641. } // setKataoAddress()
  642. /**
  643. * Set the value of [katao_siret_number] column.
  644. *
  645. * @param string $v new value
  646. * @return void
  647. */
  648. public function setKataoSiretNumber($v)
  649. {
  650. // Since the native PHP type for this column is string,
  651. // we will cast the input to a string (if it is not).
  652. if ($v !== null && !is_string($v)) {
  653. $v = (string) $v;
  654. }
  655. if ($this->katao_siret_number !== $v) {
  656. $this->katao_siret_number = $v;
  657. $this->modifiedColumns[] = KataoOrderPeer::KATAO_SIRET_NUMBER;
  658. }
  659. } // setKataoSiretNumber()
  660. /**
  661. * Set the value of [katao_rcs_number] column.
  662. *
  663. * @param string $v new value
  664. * @return void
  665. */
  666. public function setKataoRcsNumber($v)
  667. {
  668. // Since the native PHP type for this column is string,
  669. // we will cast the input to a string (if it is not).
  670. if ($v !== null && !is_string($v)) {
  671. $v = (string) $v;
  672. }
  673. if ($this->katao_rcs_number !== $v) {
  674. $this->katao_rcs_number = $v;
  675. $this->modifiedColumns[] = KataoOrderPeer::KATAO_RCS_NUMBER;
  676. }
  677. } // setKataoRcsNumber()
  678. /**
  679. * Set the value of [katao_capital] column.
  680. *
  681. * @param int $v new value
  682. * @return void
  683. */
  684. public function setKataoCapital($v)
  685. {
  686. // Since the native PHP type for this column is integer,
  687. // we will cast the input value to an int (if it is not).
  688. if ($v !== null && !is_int($v) && is_numeric($v)) {
  689. $v = (int) $v;
  690. }
  691. if ($this->katao_capital !== $v) {
  692. $this->katao_capital = $v;
  693. $this->modifiedColumns[] = KataoOrderPeer::KATAO_CAPITAL;
  694. }
  695. } // setKataoCapital()
  696. /**
  697. * Set the value of [delivery_address] column.
  698. *
  699. * @param string $v new value
  700. * @return void
  701. */
  702. public function setDeliveryAddress($v)
  703. {
  704. // Since the native PHP type for this column is string,
  705. // we will cast the input to a string (if it is not).
  706. if ($v !== null && !is_string($v)) {
  707. $v = (string) $v;
  708. }
  709. if ($this->delivery_address !== $v) {
  710. $this->delivery_address = $v;
  711. $this->modifiedColumns[] = KataoOrderPeer::DELIVERY_ADDRESS;
  712. }
  713. } // setDeliveryAddress()
  714. /**
  715. * Set the value of [created_at] column.
  716. *
  717. * @param int $v new value
  718. * @return void
  719. */
  720. public function setCreatedAt($v)
  721. {
  722. if ($v !== null && !is_int($v)) {
  723. $ts = strtotime($v);
  724. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  725. throw new PropelException("Unable to parse date/time value for [created_at] from input: " . var_export($v, true));
  726. }
  727. } else {
  728. $ts = $v;
  729. }
  730. if ($this->created_at !== $ts) {
  731. $this->created_at = $ts;
  732. $this->modifiedColumns[] = KataoOrderPeer::CREATED_AT;
  733. }
  734. } // setCreatedAt()
  735. /**
  736. * Set the value of [updated_at] column.
  737. *
  738. * @param int $v new value
  739. * @return void
  740. */
  741. public function setUpdatedAt($v)
  742. {
  743. if ($v !== null && !is_int($v)) {
  744. $ts = strtotime($v);
  745. if ($ts === -1 || $ts === false) { // in PHP 5.1 return value changes to FALSE
  746. throw new PropelException("Unable to parse date/time value for [updated_at] from input: " . var_export($v, true));
  747. }
  748. } else {
  749. $ts = $v;
  750. }
  751. if ($this->updated_at !== $ts) {
  752. $this->updated_at = $ts;
  753. $this->modifiedColumns[] = KataoOrderPeer::UPDATED_AT;
  754. }
  755. } // setUpdatedAt()
  756. /**
  757. * Hydrates (populates) the object variables with values from the database resultset.
  758. *
  759. * An offset (1-based "start column") is specified so that objects can be hydrated
  760. * with a subset of the columns in the resultset rows. This is needed, for example,
  761. * for results of JOIN queries where the resultset row includes columns from two or
  762. * more tables.
  763. *
  764. * @param ResultSet $rs The ResultSet class with cursor advanced to desired record pos.
  765. * @param int $startcol 1-based offset column which indicates which restultset column to start with.
  766. * @return int next starting column
  767. * @throws PropelException - Any caught Exception will be rewrapped as a PropelException.
  768. */
  769. public function hydrate(ResultSet $rs, $startcol = 1)
  770. {
  771. try {
  772. $this->id = $rs->getInt($startcol + 0);
  773. $this->katao_supplier_id = $rs->getInt($startcol + 1);
  774. $this->katao_period_id = $rs->getInt($startcol + 2);
  775. $this->katao_node_id = $rs->getInt($startcol + 3);
  776. $this->status = $rs->getInt($startcol + 4);
  777. $this->is_simulated = $rs->getInt($startcol + 5);
  778. $this->supplier_name = $rs->getString($startcol + 6);
  779. $this->supplier_email = $rs->getString($startcol + 7);
  780. $this->supplier_address1 = $rs->getString($startcol + 8);
  781. $this->supplier_address2 = $rs->getString($startcol + 9);
  782. $this->supplier_zip = $rs->getString($startcol + 10);
  783. $this->supplier_city = $rs->getString($startcol + 11);
  784. $this->katao_name = $rs->getString($startcol + 12);
  785. $this->katao_address = $rs->getString($startcol + 13);
  786. $this->katao_siret_number = $rs->getString($startcol + 14);
  787. $this->katao_rcs_number = $rs->getString($startcol + 15);
  788. $this->katao_capital = $rs->getInt($startcol + 16);
  789. $this->delivery_address = $rs->getString($startcol + 17);
  790. $this->created_at = $rs->getTimestamp($startcol + 18, null);
  791. $this->updated_at = $rs->getTimestamp($startcol + 19, null);
  792. $this->resetModified();
  793. $this->setNew(false);
  794. // FIXME - using NUM_COLUMNS may be clearer.
  795. return $startcol + 20; // 20 = KataoOrderPeer::NUM_COLUMNS - KataoOrderPeer::NUM_LAZY_LOAD_COLUMNS).
  796. } catch (Exception $e) {
  797. throw new PropelException("Error populating KataoOrder object", $e);
  798. }
  799. }
  800. /**
  801. * Removes this object from datastore and sets delete attribute.
  802. *
  803. * @param Connection $con
  804. * @return void
  805. * @throws PropelException
  806. * @see BaseObject::setDeleted()
  807. * @see BaseObject::isDeleted()
  808. */
  809. public function delete($con = null)
  810. {
  811. foreach (sfMixer::getCallables('BaseKataoOrder:delete:pre') as $callable)
  812. {
  813. $ret = call_user_func($callable, $this, $con);
  814. if ($ret)
  815. {
  816. return;
  817. }
  818. }
  819. if ($this->isDeleted()) {
  820. throw new PropelException("This object has already been deleted.");
  821. }
  822. if ($con === null) {
  823. $con = Propel::getConnection(KataoOrderPeer::DATABASE_NAME);
  824. }
  825. try {
  826. $con->begin();
  827. KataoOrderPeer::doDelete($this, $con);
  828. $this->setDeleted(true);
  829. $con->commit();
  830. } catch (PropelException $e) {
  831. $con->rollback();
  832. throw $e;
  833. }
  834. foreach (sfMixer::getCallables('BaseKataoOrder:delete:post') as $callable)
  835. {
  836. call_user_func($callable, $this, $con);
  837. }
  838. }
  839. /**
  840. * Stores the object in the database. If the object is new,
  841. * it inserts it; otherwise an update is performed. This method
  842. * wraps the doSave() worker method in a transaction.
  843. *
  844. * @param Connection $con
  845. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  846. * @throws PropelException
  847. * @see doSave()
  848. */
  849. public function save($con = null)
  850. {
  851. foreach (sfMixer::getCallables('BaseKataoOrder:save:pre') as $callable)
  852. {
  853. $affectedRows = call_user_func($callable, $this, $con);
  854. if (is_int($affectedRows))
  855. {
  856. return $affectedRows;
  857. }
  858. }
  859. if ($this->isNew() && !$this->isColumnModified(KataoOrderPeer::CREATED_AT))
  860. {
  861. $this->setCreatedAt(time());
  862. }
  863. if ($this->isModified() && !$this->isColumnModified(KataoOrderPeer::UPDATED_AT))
  864. {
  865. $this->setUpdatedAt(time());
  866. }
  867. if ($this->isDeleted()) {
  868. throw new PropelException("You cannot save an object that has been deleted.");
  869. }
  870. if ($con === null) {
  871. $con = Propel::getConnection(KataoOrderPeer::DATABASE_NAME);
  872. }
  873. try {
  874. $con->begin();
  875. $affectedRows = $this->doSave($con);
  876. $con->commit();
  877. foreach (sfMixer::getCallables('BaseKataoOrder:save:post') as $callable)
  878. {
  879. call_user_func($callable, $this, $con, $affectedRows);
  880. }
  881. return $affectedRows;
  882. } catch (PropelException $e) {
  883. $con->rollback();
  884. throw $e;
  885. }
  886. }
  887. /**
  888. * Stores the object in the database.
  889. *
  890. * If the object is new, it inserts it; otherwise an update is performed.
  891. * All related objects are also updated in this method.
  892. *
  893. * @param Connection $con
  894. * @return int The number of rows affected by this insert/update and any referring fk objects' save() operations.
  895. * @throws PropelException
  896. * @see save()
  897. */
  898. protected function doSave($con)
  899. {
  900. $affectedRows = 0; // initialize var to track total num of affected rows
  901. if (!$this->alreadyInSave) {
  902. $this->alreadyInSave = true;
  903. // We call the save method on the following object(s) if they
  904. // were passed to this object by their coresponding set
  905. // method. This object relates to these object(s) by a
  906. // foreign key reference.
  907. if ($this->aKataoSupplier !== null) {
  908. if ($this->aKataoSupplier->isModified()) {
  909. $affectedRows += $this->aKataoSupplier->save($con);
  910. }
  911. $this->setKataoSupplier($this->aKataoSupplier);
  912. }
  913. if ($this->aKataoPeriod !== null) {
  914. if ($this->aKataoPeriod->isModified()) {
  915. $affectedRows += $this->aKataoPeriod->save($con);
  916. }
  917. $this->setKataoPeriod($this->aKataoPeriod);
  918. }
  919. if ($this->aKataoNode !== null) {
  920. if ($this->aKataoNode->isModified()) {
  921. $affectedRows += $this->aKataoNode->save($con);
  922. }
  923. $this->setKataoNode($this->aKataoNode);
  924. }
  925. // If this object has been modified, then save it to the database.
  926. if ($this->isModified()) {
  927. if ($this->isNew()) {
  928. $pk = KataoOrderPeer::doInsert($this, $con);
  929. $affectedRows += 1; // we are assuming that there is only 1 row per doInsert() which
  930. // should always be true here (even though technically
  931. // BasePeer::doInsert() can insert multiple rows).
  932. $this->setId($pk); //[IMV] update autoincrement primary key
  933. $this->setNew(false);
  934. } else {
  935. $affectedRows += KataoOrderPeer::doUpdate($this, $con);
  936. }
  937. $this->resetModified(); // [HL] After being saved an object is no longer 'modified'
  938. }
  939. if ($this->collKataoOrderProducts !== null) {
  940. foreach($this->collKataoOrderProducts as $referrerFK) {
  941. if (!$referrerFK->isDeleted()) {
  942. $affectedRows += $referrerFK->save($con);
  943. }
  944. }
  945. }
  946. if ($this->collKataoSupplierInvoiceOrders !== null) {
  947. foreach($this->collKataoSupplierInvoiceOrders as $referrerFK) {
  948. if (!$referrerFK->isDeleted()) {
  949. $affectedRows += $referrerFK->save($con);
  950. }
  951. }
  952. }
  953. $this->alreadyInSave = false;
  954. }
  955. return $affectedRows;
  956. } // doSave()
  957. /**
  958. * Array of ValidationFailed objects.
  959. * @var array ValidationFailed[]
  960. */
  961. protected $validationFailures = array();
  962. /**
  963. * Gets any ValidationFailed objects that resulted from last call to validate().
  964. *
  965. *
  966. * @return array ValidationFailed[]
  967. * @see validate()
  968. */
  969. public function getValidationFailures()
  970. {
  971. return $this->validationFailures;
  972. }
  973. /**
  974. * Validates the objects modified field values and all objects related to this table.
  975. *
  976. * If $columns is either a column name or an array of column names
  977. * only those columns are validated.
  978. *
  979. * @param mixed $columns Column name or an array of column names.
  980. * @return boolean Whether all columns pass validation.
  981. * @see doValidate()
  982. * @see getValidationFailures()
  983. */
  984. public function validate($columns = null)
  985. {
  986. $res = $this->doValidate($columns);
  987. if ($res === true) {
  988. $this->validationFailures = array();
  989. return true;
  990. } else {
  991. $this->validationFailures = $res;
  992. return false;
  993. }
  994. }
  995. /**
  996. * This function performs the validation work for complex object models.
  997. *
  998. * In addition to checking the current object, all related objects will
  999. * also be validated. If all pass then <code>true</code> is returned; otherwise
  1000. * an aggreagated array of ValidationFailed objects will be returned.
  1001. *
  1002. * @param array $columns Array of column names to validate.
  1003. * @return mixed <code>true</code> if all validations pass; array of <code>ValidationFailed</code> objets otherwise.
  1004. */
  1005. protected function doValidate($columns = null)
  1006. {
  1007. if (!$this->alreadyInValidation) {
  1008. $this->alreadyInValidation = true;
  1009. $retval = null;
  1010. $failureMap = array();
  1011. // We call the validate method on the following object(s) if they
  1012. // were passed to this object by their coresponding set
  1013. // method. This object relates to these object(s) by a
  1014. // foreign key reference.
  1015. if ($this->aKataoSupplier !== null) {
  1016. if (!$this->aKataoSupplier->validate($columns)) {
  1017. $failureMap = array_merge($failureMap, $this->aKataoSupplier->getValidationFailures());
  1018. }
  1019. }
  1020. if ($this->aKataoPeriod !== null) {
  1021. if (!$this->aKataoPeriod->validate($columns)) {
  1022. $failureMap = array_merge($failureMap, $this->aKataoPeriod->getValidationFailures());
  1023. }
  1024. }
  1025. if ($this->aKataoNode !== null) {
  1026. if (!$this->aKataoNode->validate($columns)) {
  1027. $failureMap = array_merge($failureMap, $this->aKataoNode->getValidationFailures());
  1028. }
  1029. }
  1030. if (($retval = KataoOrderPeer::doValidate($this, $columns)) !== true) {
  1031. $failureMap = array_merge($failureMap, $retval);
  1032. }
  1033. if ($this->collKataoOrderProducts !== null) {
  1034. foreach($this->collKataoOrderProducts as $referrerFK) {
  1035. if (!$referrerFK->validate($columns)) {
  1036. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  1037. }
  1038. }
  1039. }
  1040. if ($this->collKataoSupplierInvoiceOrders !== null) {
  1041. foreach($this->collKataoSupplierInvoiceOrders as $referrerFK) {
  1042. if (!$referrerFK->validate($columns)) {
  1043. $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
  1044. }
  1045. }
  1046. }
  1047. $this->alreadyInValidation = false;
  1048. }
  1049. return (!empty($failureMap) ? $failureMap : true);
  1050. }
  1051. /**
  1052. * Retrieves a field from the object by name passed in as a string.
  1053. *
  1054. * @param string $name name
  1055. * @param string $type The type of fieldname the $name is of:
  1056. * one of the class type constants TYPE_PHPNAME,
  1057. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  1058. * @return mixed Value of field.
  1059. */
  1060. public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
  1061. {
  1062. $pos = KataoOrderPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  1063. return $this->getByPosition($pos);
  1064. }
  1065. /**
  1066. * Retrieves a field from the object by Position as specified in the xml schema.
  1067. * Zero-based.
  1068. *
  1069. * @param int $pos position in xml schema
  1070. * @return mixed Value of field at $pos
  1071. */
  1072. public function getByPosition($pos)
  1073. {
  1074. switch($pos) {
  1075. case 0:
  1076. return $this->getId();
  1077. break;
  1078. case 1:
  1079. return $this->getKataoSupplierId();
  1080. break;
  1081. case 2:
  1082. return $this->getKataoPeriodId();
  1083. break;
  1084. case 3:
  1085. return $this->getKataoNodeId();
  1086. break;
  1087. case 4:
  1088. return $this->getStatus();
  1089. break;
  1090. case 5:
  1091. return $this->getIsSimulated();
  1092. break;
  1093. case 6:
  1094. return $this->getSupplierName();
  1095. break;
  1096. case 7:
  1097. return $this->getSupplierEmail();
  1098. break;
  1099. case 8:
  1100. return $this->getSupplierAddress1();
  1101. break;
  1102. case 9:
  1103. return $this->getSupplierAddress2();
  1104. break;
  1105. case 10:
  1106. return $this->getSupplierZip();
  1107. break;
  1108. case 11:
  1109. return $this->getSupplierCity();
  1110. break;
  1111. case 12:
  1112. return $this->getKataoName();
  1113. break;
  1114. case 13:
  1115. return $this->getKataoAddress();
  1116. break;
  1117. case 14:
  1118. return $this->getKataoSiretNumber();
  1119. break;
  1120. case 15:
  1121. return $this->getKataoRcsNumber();
  1122. break;
  1123. case 16:
  1124. return $this->getKataoCapital();
  1125. break;
  1126. case 17:
  1127. return $this->getDeliveryAddress();
  1128. break;
  1129. case 18:
  1130. return $this->getCreatedAt();
  1131. break;
  1132. case 19:
  1133. return $this->getUpdatedAt();
  1134. break;
  1135. default:
  1136. return null;
  1137. break;
  1138. } // switch()
  1139. }
  1140. /**
  1141. * Exports the object as an array.
  1142. *
  1143. * You can specify the key type of the array by passing one of the class
  1144. * type constants.
  1145. *
  1146. * @param string $keyType One of the class type constants TYPE_PHPNAME,
  1147. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  1148. * @return an associative array containing the field names (as keys) and field values
  1149. */
  1150. public function toArray($keyType = BasePeer::TYPE_PHPNAME)
  1151. {
  1152. $keys = KataoOrderPeer::getFieldNames($keyType);
  1153. $result = array(
  1154. $keys[0] => $this->getId(),
  1155. $keys[1] => $this->getKataoSupplierId(),
  1156. $keys[2] => $this->getKataoPeriodId(),
  1157. $keys[3] => $this->getKataoNodeId(),
  1158. $keys[4] => $this->getStatus(),
  1159. $keys[5] => $this->getIsSimulated(),
  1160. $keys[6] => $this->getSupplierName(),
  1161. $keys[7] => $this->getSupplierEmail(),
  1162. $keys[8] => $this->getSupplierAddress1(),
  1163. $keys[9] => $this->getSupplierAddress2(),
  1164. $keys[10] => $this->getSupplierZip(),
  1165. $keys[11] => $this->getSupplierCity(),
  1166. $keys[12] => $this->getKataoName(),
  1167. $keys[13] => $this->getKataoAddress(),
  1168. $keys[14] => $this->getKataoSiretNumber(),
  1169. $keys[15] => $this->getKataoRcsNumber(),
  1170. $keys[16] => $this->getKataoCapital(),
  1171. $keys[17] => $this->getDeliveryAddress(),
  1172. $keys[18] => $this->getCreatedAt(),
  1173. $keys[19] => $this->getUpdatedAt(),
  1174. );
  1175. return $result;
  1176. }
  1177. /**
  1178. * Sets a field from the object by name passed in as a string.
  1179. *
  1180. * @param string $name peer name
  1181. * @param mixed $value field value
  1182. * @param string $type The type of fieldname the $name is of:
  1183. * one of the class type constants TYPE_PHPNAME,
  1184. * TYPE_COLNAME, TYPE_FIELDNAME, TYPE_NUM
  1185. * @return void
  1186. */
  1187. public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
  1188. {
  1189. $pos = KataoOrderPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
  1190. return $this->setByPosition($pos, $value);
  1191. }
  1192. /**
  1193. * Sets a field from the object by Position as specified in the xml schema.
  1194. * Zero-based.
  1195. *
  1196. * @param int $pos position in xml schema
  1197. * @param mixed $value field value
  1198. * @return void
  1199. */
  1200. public function setByPosition($pos, $value)
  1201. {
  1202. switch($pos) {
  1203. case 0:
  1204. $this->setId($value);
  1205. break;
  1206. case 1:
  1207. $this->setKataoSupplierId($value);
  1208. break;
  1209. case 2:
  1210. $this->setKataoPeriodId($value);
  1211. break;
  1212. case 3:
  1213. $this->setKataoNodeId($value);
  1214. break;
  1215. case 4:
  1216. $this->setStatus($value);
  1217. break;
  1218. case 5:
  1219. $this->setIsSimulated($value);
  1220. break;
  1221. case 6:
  1222. $this->setSupplierName($value);
  1223. break;
  1224. case 7:
  1225. $this->setSupplierEmail($value);
  1226. break;
  1227. case 8:
  1228. $this->setSupplierAddress1($value);
  1229. break;
  1230. case 9:
  1231. $this->setSupplierAddress2($value);
  1232. break;
  1233. case 10:
  1234. $this->setSupplierZip($value);
  1235. break;
  1236. case 11:
  1237. $this->setSupplierCity($value);
  1238. break;
  1239. case 12:
  1240. $this->setKataoName($value);
  1241. break;
  1242. case 13:
  1243. $this->setKataoAddress($value);
  1244. break;
  1245. case 14:
  1246. $this->setKataoSiretNumber($value);
  1247. break;
  1248. case 15:
  1249. $this->setKataoRcsNumber($value);
  1250. break;
  1251. case 16:
  1252. $this->setKataoCapital($value);
  1253. break;
  1254. case 17:
  1255. $this->setDeliveryAddress($value);
  1256. break;
  1257. case 18:
  1258. $this->setCreatedAt($value);
  1259. break;
  1260. case 19:
  1261. $this->setUpdatedAt($value);
  1262. break;
  1263. } // switch()
  1264. }
  1265. /**
  1266. * Populates the object using an array.
  1267. *
  1268. * This is particularly useful when populating an object from one of the
  1269. * request arrays (e.g. $_POST). This method goes through the column
  1270. * names, checking to see whether a matching key exists in populated
  1271. * array. If so the setByName() method is called for that column.
  1272. *
  1273. * You can specify the key type of the array by additionally passing one
  1274. * of the class type constants TYPE_PHPNAME, TYPE_COLNAME, TYPE_FIELDNAME,
  1275. * TYPE_NUM. The default key type is the column's phpname (e.g. 'authorId')
  1276. *
  1277. * @param array $arr An array to populate the object from.
  1278. * @param string $keyType The type of keys the array uses.
  1279. * @return void
  1280. */
  1281. public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
  1282. {
  1283. $keys = KataoOrderPeer::getFieldNames($keyType);
  1284. if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
  1285. if (array_key_exists($keys[1], $arr)) $this->setKataoSupplierId($arr[$keys[1]]);
  1286. if (array_key_exists($keys[2], $arr)) $this->setKataoPeriodId($arr[$keys[2]]);
  1287. if (array_key_exists($keys[3], $arr)) $this->setKataoNodeId($arr[$keys[3]]);
  1288. if (array_key_exists($keys[4], $arr)) $this->setStatus($arr[$keys[4]]);
  1289. if (array_key_exists($keys[5], $arr)) $this->setIsSimulated($arr[$keys[5]]);
  1290. if (array_key_exists($keys[6], $arr)) $this->setSupplierName($arr[$keys[6]]);
  1291. if (array_key_exists($keys[7], $arr)) $this->setSupplierEmail($arr[$keys[7]]);
  1292. if (array_key_exists($keys[8], $arr)) $this->setSupplierAddress1($arr[$keys[8]]);
  1293. if (array_key_exists($keys[9], $arr)) $this->setSupplierAddress2($arr[$keys[9]]);
  1294. if (array_key_exists($keys[10], $arr)) $this->setSupplierZip($arr[$keys[10]]);
  1295. if (array_key_exists($keys[11], $arr)) $this->setSupplierCity($arr[$keys[11]]);
  1296. if (array_key_exists($keys[12], $arr)) $this->setKataoName($arr[$keys[12]]);
  1297. if (array_key_exists($keys[13], $arr)) $this->setKataoAddress($arr[$keys[13]]);
  1298. if (array_key_exists($keys[14], $arr)) $this->setKataoSiretNumber($arr[$keys[14]]);
  1299. if (array_key_exists($keys[15], $arr)) $this->setKataoRcsNumber($arr[$keys[15]]);
  1300. if (array_key_exists($keys[16], $arr)) $this->setKataoCapital($arr[$keys[16]]);
  1301. if (array_key_exists($keys[17], $arr)) $this->setDeliveryAddress($arr[$keys[17]]);
  1302. if (array_key_exists($keys[18], $arr)) $this->setCreatedAt($arr[$keys[18]]);
  1303. if (array_key_exists($keys[19], $arr)) $this->setUpdatedAt($arr[$keys[19]]);
  1304. }
  1305. /**
  1306. * Build a Criteria object containing the values of all modified columns in this object.
  1307. *
  1308. * @return Criteria The Criteria object containing all modified values.
  1309. */
  1310. public function buildCriteria()
  1311. {
  1312. $criteria = new Criteria(KataoOrderPeer::DATABASE_NAME);
  1313. if ($this->isColumnModified(KataoOrderPeer::ID)) $criteria->add(KataoOrderPeer::ID, $this->id);
  1314. if ($this->isColumnModified(KataoOrderPeer::KATAO_SUPPLIER_ID)) $criteria->add(KataoOrderPeer::KATAO_SUPPLIER_ID, $this->katao_supplier_id);
  1315. if ($this->isColumnModified(KataoOrderPeer::KATAO_PERIOD_ID)) $criteria->add(KataoOrderPeer::KATAO_PERIOD_ID, $this->katao_period_id);
  1316. if ($this->isColumnModified(KataoOrderPeer::KATAO_NODE_ID)) $criteria->add(KataoOrderPeer::KATAO_NODE_ID, $this->katao_node_id);
  1317. if ($this->isColumnModified(KataoOrderPeer::STATUS)) $criteria->add(KataoOrderPeer::STATUS, $this->status);
  1318. if ($this->isColumnModified(KataoOrderPeer::IS_SIMULATED)) $criteria->add(KataoOrderPeer::IS_SIMULATED, $this->is_simulated);
  1319. if ($this->isColumnModified(KataoOrderPeer::SUPPLIER_NAME)) $criteria->add(KataoOrderPeer::SUPPLIER_NAME, $this->supplier_name);
  1320. if ($this->isColumnModified(KataoOrderPeer::SUPPLIER_EMAIL)) $criteria->add(KataoOrderPeer::SUPPLIER_EMAIL, $this->supplier_email);
  1321. if ($this->isColumnModified(KataoOrderPeer::SUPPLIER_ADDRESS1)) $criteria->add(KataoOrderPeer::SUPPLIER_ADDRESS1, $this->supplier_address1);
  1322. if ($this->isColumnModified(KataoOrderPeer::SUPPLIER_ADDRESS2)) $criteria->add(KataoOrderPeer::SUPPLIER_ADDRESS2, $this->supplier_address2);
  1323. if ($this->isColumnModified(KataoOrderPeer::SUPPLIER_ZIP)) $criteria->add(KataoOrderPeer::SUPPLIER_ZIP, $this->supplier_zip);
  1324. if ($this->isColumnModified(KataoOrderPeer::SUPPLIER_CITY)) $criteria->add(KataoOrderPeer::SUPPLIER_CITY, $this->supplier_city);
  1325. if ($this->isColumnModified(KataoOrderPeer::KATAO_NAME)) $criteria->add(KataoOrderPeer::KATAO_NAME, $this->katao_name);
  1326. if ($this->isColumnModified(KataoOrderPeer::KATAO_ADDRESS)) $criteria->add(KataoOrderPeer::KATAO_ADDRESS, $this->katao_address);
  1327. if ($this->isColumnModified(KataoOrderPeer::KATAO_SIRET_NUMBER)) $criteria->add(KataoOrderPeer::KATAO_SIRET_NUMBER, $this->katao_siret_number);
  1328. if ($this->isColumnModified(KataoOrderPeer::KATAO_RCS_NUMBER)) $criteria->add(KataoOrderPeer::KATAO_RCS_NUMBER, $this->katao_rcs_number);
  1329. if ($this->isColumnModified(KataoOrderPeer::KATAO_CAPITAL)) $criteria->add(KataoOrderPeer::KATAO_CAPITAL, $this->katao_capital);
  1330. if ($this->isColumnModified(KataoOrderPeer::DELIVERY_ADDRESS)) $criteria->add(KataoOrderPeer::DELIVERY_ADDRESS, $this->delivery_address);
  1331. if ($this->isColumnModified(KataoOrderPeer::CREATED_AT)) $criteria->add(KataoOrderPeer::CREATED_AT, $this->created_at);
  1332. if ($this->isColumnModified(KataoOrderPeer::UPDATED_AT)) $criteria->add(KataoOrderPeer::UPDATED_AT, $this->updated_at);
  1333. return $criteria;
  1334. }
  1335. /**
  1336. * Builds a Criteria object containing the primary key for this object.
  1337. *
  1338. * Unlike buildCriteria() this method includes the primary key values regardless
  1339. * of whether or not they have been modified.
  1340. *
  1341. * @return Criteria The Criteria object containing value(s) for primary key(s).
  1342. */
  1343. public function buildPkeyCriteria()
  1344. {
  1345. $criteria = new Criteria(KataoOrderPeer::DATABASE_NAME);
  1346. $criteria->add(KataoOrderPeer::ID, $this->id);
  1347. return $criteria;
  1348. }
  1349. /**
  1350. * Returns the primary key for this object (row).
  1351. * @return int
  1352. */
  1353. public function getPrimaryKey()
  1354. {
  1355. return $this->getId();
  1356. }
  1357. /**
  1358. * Generic method to set the primary key (id column).
  1359. *
  1360. * @param int $key Primary key.
  1361. * @return void
  1362. */
  1363. public function setPrimaryKey($key)
  1364. {
  1365. $this->setId($key);
  1366. }
  1367. /**
  1368. * Sets contents of passed object to values from current object.
  1369. *
  1370. * If desired, this method can also make copies of all associated (fkey referrers)
  1371. * objects.
  1372. *
  1373. * @param object $copyObj An object of KataoOrder (or compatible) type.
  1374. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  1375. * @throws PropelException
  1376. */
  1377. public function copyInto($copyObj, $deepCopy = false)
  1378. {
  1379. $copyObj->setKataoSupplierId($this->katao_supplier_id);
  1380. $copyObj->setKataoPeriodId($this->katao_period_id);
  1381. $copyObj->setKataoNodeId($this->katao_node_id);
  1382. $copyObj->setStatus($this->status);
  1383. $copyObj->setIsSimulated($this->is_simulated);
  1384. $copyObj->setSupplierName($this->supplier_name);
  1385. $copyObj->setSupplierEmail($this->supplier_email);
  1386. $copyObj->setSupplierAddress1($this->supplier_address1);
  1387. $copyObj->setSupplierAddress2($this->supplier_address2);
  1388. $copyObj->setSupplierZip($this->supplier_zip);
  1389. $copyObj->setSupplierCity($this->supplier_city);
  1390. $copyObj->setKataoName($this->katao_name);
  1391. $copyObj->setKataoAddress($this->katao_address);
  1392. $copyObj->setKataoSiretNumber($this->katao_siret_number);
  1393. $copyObj->setKataoRcsNumber($this->katao_rcs_number);
  1394. $copyObj->setKataoCapital($this->katao_capital);
  1395. $copyObj->setDeliveryAddress($this->delivery_address);
  1396. $copyObj->setCreatedAt($this->created_at);
  1397. $copyObj->setUpdatedAt($this->updated_at);
  1398. if ($deepCopy) {
  1399. // important: temporarily setNew(false) because this affects the behavior of
  1400. // the getter/setter methods for fkey referrer objects.
  1401. $copyObj->setNew(false);
  1402. foreach($this->getKataoOrderProducts() as $relObj) {
  1403. $copyObj->addKataoOrderProduct($relObj->copy($deepCopy));
  1404. }
  1405. foreach($this->getKataoSupplierInvoiceOrders() as $relObj) {
  1406. $copyObj->addKataoSupplierInvoiceOrder($relObj->copy($deepCopy));
  1407. }
  1408. } // if ($deepCopy)
  1409. $copyObj->setNew(true);
  1410. $copyObj->setId(NULL); // this is a pkey column, so set to default value
  1411. }
  1412. /**
  1413. * Makes a copy of this object that will be inserted as a new row in table when saved.
  1414. * It creates a new object filling in the simple attributes, but skipping any primary
  1415. * keys that are defined for the table.
  1416. *
  1417. * If desired, this method can also make copies of all associated (fkey referrers)
  1418. * objects.
  1419. *
  1420. * @param boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  1421. * @return KataoOrder Clone of current object.
  1422. * @throws PropelException
  1423. */
  1424. public function copy($deepCopy = false)
  1425. {
  1426. // we use get_class(), because this might be a subclass
  1427. $clazz = get_class($this);
  1428. $copyObj = new $clazz();
  1429. $this->copyInto($copyObj, $deepCopy);
  1430. return $copyObj;
  1431. }
  1432. /**
  1433. * Returns a peer instance associated with this om.
  1434. *
  1435. * Since Peer classes are not to have any instance attributes, this method returns the
  1436. * same instance for all member of this class. The method could therefore
  1437. * be static, but this would prevent one from overriding the behavior.
  1438. *
  1439. * @return KataoOrderPeer
  1440. */
  1441. public function getPeer()
  1442. {
  1443. if (self::$peer === null) {
  1444. self::$peer = new KataoOrderPeer();
  1445. }
  1446. return self::$peer;
  1447. }
  1448. /**
  1449. * Declares an association between this object and a KataoSupplier object.
  1450. *
  1451. * @param KataoSupplier $v
  1452. * @return void
  1453. * @throws PropelException
  1454. */
  1455. public function setKataoSupplier($v)
  1456. {
  1457. if ($v === null) {
  1458. $this->setKataoSupplierId(NULL);
  1459. } else {
  1460. $this->setKataoSupplierId($v->getId());
  1461. }
  1462. $this->aKataoSupplier = $v;
  1463. }
  1464. /**
  1465. * Get the associated KataoSupplier object
  1466. *
  1467. * @param Connection Optional Connection object.
  1468. * @return KataoSupplier The associated KataoSupplier object.
  1469. * @throws PropelException
  1470. */
  1471. public function getKataoSupplier($con = null)
  1472. {
  1473. if ($this->aKataoSupplier === null && ($this->katao_supplier_id !== null)) {
  1474. // include the related Peer class
  1475. $this->aKataoSupplier = KataoSupplierPeer::retrieveByPK($this->katao_supplier_id, $con);
  1476. /* The following can be used instead of the line above to
  1477. guarantee the related object contains a reference
  1478. to this object, but this level of coupling
  1479. may be undesirable in many circumstances.
  1480. As it can lead to a db query with many results that may
  1481. never be used.
  1482. $obj = KataoSupplierPeer::retrieveByPK($this->katao_supplier_id, $con);
  1483. $obj->addKataoSuppliers($this);
  1484. */
  1485. }
  1486. return $this->aKataoSupplier;
  1487. }
  1488. /**
  1489. * Declares an association between this object and a KataoPeriod object.
  1490. *
  1491. * @param KataoPeriod $v
  1492. * @return void
  1493. * @throws PropelException
  1494. */
  1495. public function setKataoPeriod($v)
  1496. {
  1497. if ($v === null) {
  1498. $this->setKataoPeriodId(NULL);
  1499. } else {
  1500. $this->setKataoPeriodId($v->getId());
  1501. }
  1502. $this->aKataoPeriod = $v;
  1503. }
  1504. /**
  1505. * Get the associated KataoPeriod object
  1506. *
  1507. * @param Connection Optional Connection object.
  1508. * @return KataoPeriod The associated KataoPeriod object.
  1509. * @throws PropelException
  1510. */
  1511. public function getKataoPeriod($con = null)
  1512. {
  1513. if ($this->aKataoPeriod === null && ($this->katao_period_id !== null)) {
  1514. // include the related Peer class
  1515. $this->aKataoPeriod = KataoPeriodPeer::retrieveByPK($this->katao_period_id, $con);
  1516. /* The following can be used instead of the line above to
  1517. guarantee the related object contains a reference
  1518. to this object, but this level of coupling
  1519. may be undesirable in many circumstances.
  1520. As it can lead to a db query with many results that may
  1521. never be used.
  1522. $obj = KataoPeriodPeer::retrieveByPK($this->katao_period_id, $con);
  1523. $obj->addKataoPeriods($this);
  1524. */
  1525. }
  1526. return $this->aKataoPeriod;
  1527. }
  1528. /**
  1529. * Declares an association between this object and a KataoNode object.
  1530. *
  1531. * @param KataoNode $v
  1532. * @return void
  1533. * @throws PropelException
  1534. */
  1535. public function setKataoNode($v)
  1536. {
  1537. if ($v === null) {
  1538. $this->setKataoNodeId(NULL);
  1539. } else {
  1540. $this->setKataoNodeId($v->getId());
  1541. }
  1542. $this->aKataoNode = $v;
  1543. }
  1544. /**
  1545. * Get the associated KataoNode object
  1546. *
  1547. * @param Connection Optional Connection object.
  1548. * @return KataoNode The associated KataoNode object.
  1549. * @throws PropelException
  1550. */
  1551. public function getKataoNode($con = null)
  1552. {
  1553. if ($this->aKataoNode === null && ($this->katao_node_id !== null)) {
  1554. // include the related Peer class
  1555. $this->aKataoNode = KataoNodePeer::retrieveByPK($this->katao_node_id, $con);
  1556. /* The following can be used instead of the line above to
  1557. guarantee the related object contains a reference
  1558. to this object, but this level of coupling
  1559. may be undesirable in many circumstances.
  1560. As it can lead to a db query with many results that may
  1561. never be used.
  1562. $obj = KataoNodePeer::retrieveByPK($this->katao_node_id, $con);
  1563. $obj->addKataoNodes($this);
  1564. */
  1565. }
  1566. return $this->aKataoNode;
  1567. }
  1568. /**
  1569. * Temporary storage of collKataoOrderProducts to save a possible db hit in
  1570. * the event objects are add to the collection, but the
  1571. * complete collection is never requested.
  1572. * @return void
  1573. */
  1574. public function initKataoOrderProducts()
  1575. {
  1576. if ($this->collKataoOrderProducts === null) {
  1577. $this->collKataoOrderProducts = array();
  1578. }
  1579. }
  1580. /**
  1581. * If this collection has already been initialized with
  1582. * an identical criteria, it returns the collection.
  1583. * Otherwise if this KataoOrder has previously
  1584. * been saved, it will retrieve related KataoOrderProducts from storage.
  1585. * If this KataoOrder is new, it will return
  1586. * an empty collection or the current collection, the criteria
  1587. * is ignored on a new object.
  1588. *
  1589. * @param Connection $con
  1590. * @param Criteria $criteria
  1591. * @throws PropelException
  1592. */
  1593. public function getKataoOrderProducts($criteria = null, $con = null)
  1594. {
  1595. // include the Peer class
  1596. if ($criteria === null) {
  1597. $criteria = new Criteria();
  1598. }
  1599. elseif ($criteria instanceof Criteria)
  1600. {
  1601. $criteria = clone $criteria;
  1602. }
  1603. if ($this->collKataoOrderProducts === null) {
  1604. if ($this->isNew()) {
  1605. $this->collKataoOrderProducts = array();
  1606. } else {
  1607. $criteria->add(KataoOrderProductPeer::KATAO_ORDER_ID, $this->getId());
  1608. KataoOrderProductPeer::addSelectColumns($criteria);
  1609. $this->collKataoOrderProducts = KataoOrderProductPeer::doSelect($criteria, $con);
  1610. }
  1611. } else {
  1612. // criteria has no effect for a new object
  1613. if (!$this->isNew()) {
  1614. // the following code is to determine if a new query is
  1615. // called for. If the criteria is the same as the last
  1616. // one, just return the collection.
  1617. $criteria->add(KataoOrderProductPeer::KATAO_ORDER_ID, $this->getId());
  1618. KataoOrderProductPeer::addSelectColumns($criteria);
  1619. if (!isset($this->lastKataoOrderProductCriteria) || !$this->lastKataoOrderProductCriteria->equals($criteria)) {
  1620. $this->collKataoOrderProducts = KataoOrderProductPeer::doSelect($criteria, $con);
  1621. }
  1622. }
  1623. }
  1624. $this->lastKataoOrderProductCriteria = $criteria;
  1625. return $this->collKataoOrderProducts;
  1626. }
  1627. /**
  1628. * Returns the number of related KataoOrderProducts.
  1629. *
  1630. * @param Criteria $criteria
  1631. * @param boolean $distinct
  1632. * @param Connection $con
  1633. * @throws PropelException
  1634. */
  1635. public function countKataoOrderProducts($criteria = null, $distinct = false, $con = null)
  1636. {
  1637. // include the Peer class
  1638. if ($criteria === null) {
  1639. $criteria = new Criteria();
  1640. }
  1641. elseif ($criteria instanceof Criteria)
  1642. {
  1643. $criteria = clone $criteria;
  1644. }
  1645. $criteria->add(KataoOrderProductPeer::KATAO_ORDER_ID, $this->getId());
  1646. return KataoOrderProductPeer::doCount($criteria, $distinct, $con);
  1647. }
  1648. /**
  1649. * Method called to associate a KataoOrderProduct object to this object
  1650. * through the KataoOrderProduct foreign key attribute
  1651. *
  1652. * @param KataoOrderProduct $l KataoOrderProduct
  1653. * @return void
  1654. * @throws PropelException
  1655. */
  1656. public function addKataoOrderProduct(KataoOrderProduct $l)
  1657. {
  1658. $this->collKataoOrderProducts[] = $l;
  1659. $l->setKataoOrder($this);
  1660. }
  1661. /**
  1662. * If this collection has already been initialized with
  1663. * an identical criteria, it returns the collection.
  1664. * Otherwise if this KataoOrder is new, it will return
  1665. * an empty collection; or if this KataoOrder has previously
  1666. * been saved, it will retrieve related KataoOrderProducts from storage.
  1667. *
  1668. * This method is protected by default in order to keep the public
  1669. * api reasonable. You can provide public methods for those you
  1670. * actually need in KataoOrder.
  1671. */
  1672. public function getKataoOrderProductsJoinKataoProduct($criteria = null, $con = null)
  1673. {
  1674. // include the Peer class
  1675. if ($criteria === null) {
  1676. $criteria = new Criteria();
  1677. }
  1678. elseif ($criteria instanceof Criteria)
  1679. {
  1680. $criteria = clone $criteria;
  1681. }
  1682. if ($this->collKataoOrderProducts === null) {
  1683. if ($this->isNew()) {
  1684. $this->collKataoOrderProducts = array();
  1685. } else {
  1686. $criteria->add(KataoOrderProductPeer::KATAO_ORDER_ID, $this->getId());
  1687. $this->collKataoOrderProducts = KataoOrderProductPeer::doSelectJoinKataoProduct($criteria, $con);
  1688. }
  1689. } else {
  1690. // the following code is to determine if a new query is
  1691. // called for. If the criteria is the same as the last
  1692. // one, just return the collection.
  1693. $criteria->add(KataoOrderProductPeer::KATAO_ORDER_ID, $this->getId());
  1694. if (!isset($this->lastKataoOrderProductCriteria) || !$this->lastKataoOrderProductCriteria->equals($criteria)) {
  1695. $this->collKataoOrderProducts = KataoOrderProductPeer::doSelectJoinKataoProduct($criteria, $con);
  1696. }
  1697. }
  1698. $this->lastKataoOrderProductCriteria = $criteria;
  1699. return $this->collKataoOrderProducts;
  1700. }
  1701. /**
  1702. * Temporary storage of collKataoSupplierInvoiceOrders to save a possible db hit in
  1703. * the event objects are add to the collection, but the
  1704. * complete collection is never requested.
  1705. * @return void
  1706. */
  1707. public function initKataoSupplierInvoiceOrders()
  1708. {
  1709. if ($this->collKataoSupplierInvoiceOrders === null) {
  1710. $this->collKataoSupplierInvoiceOrders = array();
  1711. }
  1712. }
  1713. /**
  1714. * If this collection has already been initialized with
  1715. * an identical criteria, it returns the collection.
  1716. * Otherwise if this KataoOrder has previously
  1717. * been saved, it will retrieve related KataoSupplierInvoiceOrders from storage.
  1718. * If this KataoOrder is new, it will return
  1719. * an empty collection or the current collection, the criteria
  1720. * is ignored on a new object.
  1721. *
  1722. * @param Connection $con
  1723. * @param Criteria $criteria
  1724. * @throws PropelException
  1725. */
  1726. public function getKataoSupplierInvoiceOrders($criteria = null, $con = null)
  1727. {
  1728. // include the Peer class
  1729. if ($criteria === null) {
  1730. $criteria = new Criteria();
  1731. }
  1732. elseif ($criteria instanceof Criteria)
  1733. {
  1734. $criteria = clone $criteria;
  1735. }
  1736. if ($this->collKataoSupplierInvoiceOrders === null) {
  1737. if ($this->isNew()) {
  1738. $this->collKataoSupplierInvoiceOrders = array();
  1739. } else {
  1740. $criteria->add(KataoSupplierInvoiceOrderPeer::KATAO_ORDER_ID, $this->getId());
  1741. KataoSupplierInvoiceOrderPeer::addSelectColumns($criteria);
  1742. $this->collKataoSupplierInvoiceOrders = KataoSupplierInvoiceOrderPeer::doSelect($criteria, $con);
  1743. }
  1744. } else {
  1745. // criteria has no effect for a new object
  1746. if (!$this->isNew()) {
  1747. // the following code is to determine if a new query is
  1748. // called for. If the criteria is the same as the last
  1749. // one, just return the collection.
  1750. $criteria->add(KataoSupplierInvoiceOrderPeer::KATAO_ORDER_ID, $this->getId());
  1751. KataoSupplierInvoiceOrderPeer::addSelectColumns($criteria);
  1752. if (!isset($this->lastKataoSupplierInvoiceOrderCriteria) || !$this->lastKataoSupplierInvoiceOrderCriteria->equals($criteria)) {
  1753. $this->collKataoSupplierInvoiceOrders = KataoSupplierInvoiceOrderPeer::doSelect($criteria, $con);
  1754. }
  1755. }
  1756. }
  1757. $this->lastKataoSupplierInvoiceOrderCriteria = $criteria;
  1758. return $this->collKataoSupplierInvoiceOrders;
  1759. }
  1760. /**
  1761. * Returns the number of related KataoSupplierInvoiceOrders.
  1762. *
  1763. * @param Criteria $criteria
  1764. * @param boolean $distinct
  1765. * @param Connection $con
  1766. * @throws PropelException
  1767. */
  1768. public function countKataoSupplierInvoiceOrders($criteria = null, $distinct = false, $con = null)
  1769. {
  1770. // include the Peer class
  1771. if ($criteria === null) {
  1772. $criteria = new Criteria();
  1773. }
  1774. elseif ($criteria instanceof Criteria)
  1775. {
  1776. $criteria = clone $criteria;
  1777. }
  1778. $criteria->add(KataoSupplierInvoiceOrderPeer::KATAO_ORDER_ID, $this->getId());
  1779. return KataoSupplierInvoiceOrderPeer::doCount($criteria, $distinct, $con);
  1780. }
  1781. /**
  1782. * Method called to associate a KataoSupplierInvoiceOrder object to this object
  1783. * through the KataoSupplierInvoiceOrder foreign key attribute
  1784. *
  1785. * @param KataoSupplierInvoiceOrder $l KataoSupplierInvoiceOrder
  1786. * @return void
  1787. * @throws PropelException
  1788. */
  1789. public function addKataoSupplierInvoiceOrder(KataoSupplierInvoiceOrder $l)
  1790. {
  1791. $this->collKataoSupplierInvoiceOrders[] = $l;
  1792. $l->setKataoOrder($this);
  1793. }
  1794. /**
  1795. * If this collection has already been initialized with
  1796. * an identical criteria, it returns the collection.
  1797. * Otherwise if this KataoOrder is new, it will return
  1798. * an empty collection; or if this KataoOrder has previously
  1799. * been saved, it will retrieve related KataoSupplierInvoiceOrders from storage.
  1800. *
  1801. * This method is protected by default in order to keep the public
  1802. * api reasonable. You can provide public methods for those you
  1803. * actually need in KataoOrder.
  1804. */
  1805. public function getKataoSupplierInvoiceOrdersJoinKataoSupplierInvoice($criteria = null, $con = null)
  1806. {
  1807. // include the Peer class
  1808. if ($criteria === null) {
  1809. $criteria = new Criteria();
  1810. }
  1811. elseif ($criteria instanceof Criteria)
  1812. {
  1813. $criteria = clone $criteria;
  1814. }
  1815. if ($this->collKataoSupplierInvoiceOrders === null) {
  1816. if ($this->isNew()) {
  1817. $this->collKataoSupplierInvoiceOrders = array();
  1818. } else {
  1819. $criteria->add(KataoSupplierInvoiceOrderPeer::KATAO_ORDER_ID, $this->getId());
  1820. $this->collKataoSupplierInvoiceOrders = KataoSupplierInvoiceOrderPeer::doSelectJoinKataoSupplierInvoice($criteria, $con);
  1821. }
  1822. } else {
  1823. // the following code is to determine if a new query is
  1824. // called for. If the criteria is the same as the last
  1825. // one, just return the collection.
  1826. $criteria->add(KataoSupplierInvoiceOrderPeer::KATAO_ORDER_ID, $this->getId());
  1827. if (!isset($this->lastKataoSupplierInvoiceOrderCriteria) || !$this->lastKataoSupplierInvoiceOrderCriteria->equals($criteria)) {
  1828. $this->collKataoSupplierInvoiceOrders = KataoSupplierInvoiceOrderPeer::doSelectJoinKataoSupplierInvoice($criteria, $con);
  1829. }
  1830. }
  1831. $this->lastKataoSupplierInvoiceOrderCriteria = $criteria;
  1832. return $this->collKataoSupplierInvoiceOrders;
  1833. }
  1834. public function __call($method, $arguments)
  1835. {
  1836. if (!$callable = sfMixer::getCallable('BaseKataoOrder:'.$method))
  1837. {
  1838. throw new sfException(sprintf('Call to undefined method BaseKataoOrder::%s', $method));
  1839. }
  1840. array_unshift($arguments, $this);
  1841. return call_user_func_array($callable, $arguments);
  1842. }
  1843. } // BaseKataoOrder