BaseKataoConfig.php 59 KB

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