BaseKataoUser.php 55 KB

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