BaseKataoSupplier.php 95 KB

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