BaseKataoProduct.php 84 KB

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