1: <?php
2:
3: namespace Thelia\Model\om;
4:
5: use \BaseObject;
6: use \BasePeer;
7: use \Criteria;
8: use \DateTime;
9: use \Exception;
10: use \PDO;
11: use \Persistent;
12: use \Propel;
13: use \PropelCollection;
14: use \PropelDateTime;
15: use \PropelException;
16: use \PropelObjectCollection;
17: use \PropelPDO;
18: use Thelia\Model\Category;
19: use Thelia\Model\CategoryQuery;
20: use Thelia\Model\Content;
21: use Thelia\Model\ContentQuery;
22: use Thelia\Model\Document;
23: use Thelia\Model\DocumentI18n;
24: use Thelia\Model\DocumentI18nQuery;
25: use Thelia\Model\DocumentPeer;
26: use Thelia\Model\DocumentQuery;
27: use Thelia\Model\Folder;
28: use Thelia\Model\FolderQuery;
29: use Thelia\Model\Product;
30: use Thelia\Model\ProductQuery;
31:
32: 33: 34: 35: 36: 37: 38:
39: abstract class BaseDocument extends BaseObject implements Persistent
40: {
41: 42: 43:
44: const PEER = 'Thelia\\Model\\DocumentPeer';
45:
46: 47: 48: 49: 50: 51:
52: protected static $peer;
53:
54: 55: 56: 57:
58: protected $startCopy = false;
59:
60: 61: 62: 63:
64: protected $id;
65:
66: 67: 68: 69:
70: protected $product_id;
71:
72: 73: 74: 75:
76: protected $category_id;
77:
78: 79: 80: 81:
82: protected $folder_id;
83:
84: 85: 86: 87:
88: protected $content_id;
89:
90: 91: 92: 93:
94: protected $file;
95:
96: 97: 98: 99:
100: protected $position;
101:
102: 103: 104: 105:
106: protected $created_at;
107:
108: 109: 110: 111:
112: protected $updated_at;
113:
114: 115: 116:
117: protected $aProduct;
118:
119: 120: 121:
122: protected $aCategory;
123:
124: 125: 126:
127: protected $aContent;
128:
129: 130: 131:
132: protected $aFolder;
133:
134: 135: 136:
137: protected $collDocumentI18ns;
138: protected $collDocumentI18nsPartial;
139:
140: 141: 142: 143: 144:
145: protected $alreadyInSave = false;
146:
147: 148: 149: 150: 151:
152: protected $alreadyInValidation = false;
153:
154:
155:
156: 157: 158: 159:
160: protected $currentLocale = 'en_EN';
161:
162: 163: 164: 165:
166: protected $currentTranslations;
167:
168: 169: 170: 171:
172: protected $documentI18nsScheduledForDeletion = null;
173:
174: 175: 176: 177: 178:
179: public function getId()
180: {
181: return $this->id;
182: }
183:
184: 185: 186: 187: 188:
189: public function getProductId()
190: {
191: return $this->product_id;
192: }
193:
194: 195: 196: 197: 198:
199: public function getCategoryId()
200: {
201: return $this->category_id;
202: }
203:
204: 205: 206: 207: 208:
209: public function getFolderId()
210: {
211: return $this->folder_id;
212: }
213:
214: 215: 216: 217: 218:
219: public function getContentId()
220: {
221: return $this->content_id;
222: }
223:
224: 225: 226: 227: 228:
229: public function getFile()
230: {
231: return $this->file;
232: }
233:
234: 235: 236: 237: 238:
239: public function getPosition()
240: {
241: return $this->position;
242: }
243:
244: 245: 246: 247: 248: 249: 250: 251: 252:
253: public function getCreatedAt($format = 'Y-m-d H:i:s')
254: {
255: if ($this->created_at === null) {
256: return null;
257: }
258:
259: if ($this->created_at === '0000-00-00 00:00:00') {
260:
261:
262: return null;
263: } else {
264: try {
265: $dt = new DateTime($this->created_at);
266: } catch (Exception $x) {
267: throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->created_at, true), $x);
268: }
269: }
270:
271: if ($format === null) {
272:
273: return $dt;
274: } elseif (strpos($format, '%') !== false) {
275: return strftime($format, $dt->format('U'));
276: } else {
277: return $dt->format($format);
278: }
279: }
280:
281: 282: 283: 284: 285: 286: 287: 288: 289:
290: public function getUpdatedAt($format = 'Y-m-d H:i:s')
291: {
292: if ($this->updated_at === null) {
293: return null;
294: }
295:
296: if ($this->updated_at === '0000-00-00 00:00:00') {
297:
298:
299: return null;
300: } else {
301: try {
302: $dt = new DateTime($this->updated_at);
303: } catch (Exception $x) {
304: throw new PropelException("Internally stored date/time/timestamp value could not be converted to DateTime: " . var_export($this->updated_at, true), $x);
305: }
306: }
307:
308: if ($format === null) {
309:
310: return $dt;
311: } elseif (strpos($format, '%') !== false) {
312: return strftime($format, $dt->format('U'));
313: } else {
314: return $dt->format($format);
315: }
316: }
317:
318: 319: 320: 321: 322: 323:
324: public function setId($v)
325: {
326: if ($v !== null) {
327: $v = (int) $v;
328: }
329:
330: if ($this->id !== $v) {
331: $this->id = $v;
332: $this->modifiedColumns[] = DocumentPeer::ID;
333: }
334:
335:
336: return $this;
337: }
338:
339: 340: 341: 342: 343: 344:
345: public function setProductId($v)
346: {
347: if ($v !== null) {
348: $v = (int) $v;
349: }
350:
351: if ($this->product_id !== $v) {
352: $this->product_id = $v;
353: $this->modifiedColumns[] = DocumentPeer::PRODUCT_ID;
354: }
355:
356: if ($this->aProduct !== null && $this->aProduct->getId() !== $v) {
357: $this->aProduct = null;
358: }
359:
360:
361: return $this;
362: }
363:
364: 365: 366: 367: 368: 369:
370: public function setCategoryId($v)
371: {
372: if ($v !== null) {
373: $v = (int) $v;
374: }
375:
376: if ($this->category_id !== $v) {
377: $this->category_id = $v;
378: $this->modifiedColumns[] = DocumentPeer::CATEGORY_ID;
379: }
380:
381: if ($this->aCategory !== null && $this->aCategory->getId() !== $v) {
382: $this->aCategory = null;
383: }
384:
385:
386: return $this;
387: }
388:
389: 390: 391: 392: 393: 394:
395: public function setFolderId($v)
396: {
397: if ($v !== null) {
398: $v = (int) $v;
399: }
400:
401: if ($this->folder_id !== $v) {
402: $this->folder_id = $v;
403: $this->modifiedColumns[] = DocumentPeer::FOLDER_ID;
404: }
405:
406: if ($this->aFolder !== null && $this->aFolder->getId() !== $v) {
407: $this->aFolder = null;
408: }
409:
410:
411: return $this;
412: }
413:
414: 415: 416: 417: 418: 419:
420: public function setContentId($v)
421: {
422: if ($v !== null) {
423: $v = (int) $v;
424: }
425:
426: if ($this->content_id !== $v) {
427: $this->content_id = $v;
428: $this->modifiedColumns[] = DocumentPeer::CONTENT_ID;
429: }
430:
431: if ($this->aContent !== null && $this->aContent->getId() !== $v) {
432: $this->aContent = null;
433: }
434:
435:
436: return $this;
437: }
438:
439: 440: 441: 442: 443: 444:
445: public function setFile($v)
446: {
447: if ($v !== null) {
448: $v = (string) $v;
449: }
450:
451: if ($this->file !== $v) {
452: $this->file = $v;
453: $this->modifiedColumns[] = DocumentPeer::FILE;
454: }
455:
456:
457: return $this;
458: }
459:
460: 461: 462: 463: 464: 465:
466: public function setPosition($v)
467: {
468: if ($v !== null) {
469: $v = (int) $v;
470: }
471:
472: if ($this->position !== $v) {
473: $this->position = $v;
474: $this->modifiedColumns[] = DocumentPeer::POSITION;
475: }
476:
477:
478: return $this;
479: }
480:
481: 482: 483: 484: 485: 486: 487:
488: public function setCreatedAt($v)
489: {
490: $dt = PropelDateTime::newInstance($v, null, 'DateTime');
491: if ($this->created_at !== null || $dt !== null) {
492: $currentDateAsString = ($this->created_at !== null && $tmpDt = new DateTime($this->created_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
493: $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;
494: if ($currentDateAsString !== $newDateAsString) {
495: $this->created_at = $newDateAsString;
496: $this->modifiedColumns[] = DocumentPeer::CREATED_AT;
497: }
498: }
499:
500:
501: return $this;
502: }
503:
504: 505: 506: 507: 508: 509: 510:
511: public function setUpdatedAt($v)
512: {
513: $dt = PropelDateTime::newInstance($v, null, 'DateTime');
514: if ($this->updated_at !== null || $dt !== null) {
515: $currentDateAsString = ($this->updated_at !== null && $tmpDt = new DateTime($this->updated_at)) ? $tmpDt->format('Y-m-d H:i:s') : null;
516: $newDateAsString = $dt ? $dt->format('Y-m-d H:i:s') : null;
517: if ($currentDateAsString !== $newDateAsString) {
518: $this->updated_at = $newDateAsString;
519: $this->modifiedColumns[] = DocumentPeer::UPDATED_AT;
520: }
521: }
522:
523:
524: return $this;
525: }
526:
527: 528: 529: 530: 531: 532: 533: 534:
535: public function hasOnlyDefaultValues()
536: {
537:
538: return true;
539: }
540:
541: 542: 543: 544: 545: 546: 547: 548: 549: 550: 551: 552: 553: 554:
555: public function hydrate($row, $startcol = 0, $rehydrate = false)
556: {
557: try {
558:
559: $this->id = ($row[$startcol + 0] !== null) ? (int) $row[$startcol + 0] : null;
560: $this->product_id = ($row[$startcol + 1] !== null) ? (int) $row[$startcol + 1] : null;
561: $this->category_id = ($row[$startcol + 2] !== null) ? (int) $row[$startcol + 2] : null;
562: $this->folder_id = ($row[$startcol + 3] !== null) ? (int) $row[$startcol + 3] : null;
563: $this->content_id = ($row[$startcol + 4] !== null) ? (int) $row[$startcol + 4] : null;
564: $this->file = ($row[$startcol + 5] !== null) ? (string) $row[$startcol + 5] : null;
565: $this->position = ($row[$startcol + 6] !== null) ? (int) $row[$startcol + 6] : null;
566: $this->created_at = ($row[$startcol + 7] !== null) ? (string) $row[$startcol + 7] : null;
567: $this->updated_at = ($row[$startcol + 8] !== null) ? (string) $row[$startcol + 8] : null;
568: $this->resetModified();
569:
570: $this->setNew(false);
571:
572: if ($rehydrate) {
573: $this->ensureConsistency();
574: }
575:
576: return $startcol + 9;
577:
578: } catch (Exception $e) {
579: throw new PropelException("Error populating Document object", $e);
580: }
581: }
582:
583: 584: 585: 586: 587: 588: 589: 590: 591: 592: 593: 594: 595:
596: public function ensureConsistency()
597: {
598:
599: if ($this->aProduct !== null && $this->product_id !== $this->aProduct->getId()) {
600: $this->aProduct = null;
601: }
602: if ($this->aCategory !== null && $this->category_id !== $this->aCategory->getId()) {
603: $this->aCategory = null;
604: }
605: if ($this->aFolder !== null && $this->folder_id !== $this->aFolder->getId()) {
606: $this->aFolder = null;
607: }
608: if ($this->aContent !== null && $this->content_id !== $this->aContent->getId()) {
609: $this->aContent = null;
610: }
611: }
612:
613: 614: 615: 616: 617: 618: 619: 620: 621: 622:
623: public function reload($deep = false, PropelPDO $con = null)
624: {
625: if ($this->isDeleted()) {
626: throw new PropelException("Cannot reload a deleted object.");
627: }
628:
629: if ($this->isNew()) {
630: throw new PropelException("Cannot reload an unsaved object.");
631: }
632:
633: if ($con === null) {
634: $con = Propel::getConnection(DocumentPeer::DATABASE_NAME, Propel::CONNECTION_READ);
635: }
636:
637:
638:
639:
640: $stmt = DocumentPeer::doSelectStmt($this->buildPkeyCriteria(), $con);
641: $row = $stmt->fetch(PDO::FETCH_NUM);
642: $stmt->closeCursor();
643: if (!$row) {
644: throw new PropelException('Cannot find matching row in the database to reload object values.');
645: }
646: $this->hydrate($row, 0, true);
647:
648: if ($deep) {
649:
650: $this->aProduct = null;
651: $this->aCategory = null;
652: $this->aContent = null;
653: $this->aFolder = null;
654: $this->collDocumentI18ns = null;
655:
656: }
657: }
658:
659: 660: 661: 662: 663: 664: 665: 666: 667: 668:
669: public function delete(PropelPDO $con = null)
670: {
671: if ($this->isDeleted()) {
672: throw new PropelException("This object has already been deleted.");
673: }
674:
675: if ($con === null) {
676: $con = Propel::getConnection(DocumentPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
677: }
678:
679: $con->beginTransaction();
680: try {
681: $deleteQuery = DocumentQuery::create()
682: ->filterByPrimaryKey($this->getPrimaryKey());
683: $ret = $this->preDelete($con);
684: if ($ret) {
685: $deleteQuery->delete($con);
686: $this->postDelete($con);
687: $con->commit();
688: $this->setDeleted(true);
689: } else {
690: $con->commit();
691: }
692: } catch (Exception $e) {
693: $con->rollBack();
694: throw $e;
695: }
696: }
697:
698: 699: 700: 701: 702: 703: 704: 705: 706: 707: 708: 709: 710: 711:
712: public function save(PropelPDO $con = null)
713: {
714: if ($this->isDeleted()) {
715: throw new PropelException("You cannot save an object that has been deleted.");
716: }
717:
718: if ($con === null) {
719: $con = Propel::getConnection(DocumentPeer::DATABASE_NAME, Propel::CONNECTION_WRITE);
720: }
721:
722: $con->beginTransaction();
723: $isInsert = $this->isNew();
724: try {
725: $ret = $this->preSave($con);
726: if ($isInsert) {
727: $ret = $ret && $this->preInsert($con);
728:
729: if (!$this->isColumnModified(DocumentPeer::CREATED_AT)) {
730: $this->setCreatedAt(time());
731: }
732: if (!$this->isColumnModified(DocumentPeer::UPDATED_AT)) {
733: $this->setUpdatedAt(time());
734: }
735: } else {
736: $ret = $ret && $this->preUpdate($con);
737:
738: if ($this->isModified() && !$this->isColumnModified(DocumentPeer::UPDATED_AT)) {
739: $this->setUpdatedAt(time());
740: }
741: }
742: if ($ret) {
743: $affectedRows = $this->doSave($con);
744: if ($isInsert) {
745: $this->postInsert($con);
746: } else {
747: $this->postUpdate($con);
748: }
749: $this->postSave($con);
750: DocumentPeer::addInstanceToPool($this);
751: } else {
752: $affectedRows = 0;
753: }
754: $con->commit();
755:
756: return $affectedRows;
757: } catch (Exception $e) {
758: $con->rollBack();
759: throw $e;
760: }
761: }
762:
763: 764: 765: 766: 767: 768: 769: 770: 771: 772: 773:
774: protected function doSave(PropelPDO $con)
775: {
776: $affectedRows = 0;
777: if (!$this->alreadyInSave) {
778: $this->alreadyInSave = true;
779:
780:
781:
782:
783:
784:
785: if ($this->aProduct !== null) {
786: if ($this->aProduct->isModified() || $this->aProduct->isNew()) {
787: $affectedRows += $this->aProduct->save($con);
788: }
789: $this->setProduct($this->aProduct);
790: }
791:
792: if ($this->aCategory !== null) {
793: if ($this->aCategory->isModified() || $this->aCategory->isNew()) {
794: $affectedRows += $this->aCategory->save($con);
795: }
796: $this->setCategory($this->aCategory);
797: }
798:
799: if ($this->aContent !== null) {
800: if ($this->aContent->isModified() || $this->aContent->isNew()) {
801: $affectedRows += $this->aContent->save($con);
802: }
803: $this->setContent($this->aContent);
804: }
805:
806: if ($this->aFolder !== null) {
807: if ($this->aFolder->isModified() || $this->aFolder->isNew()) {
808: $affectedRows += $this->aFolder->save($con);
809: }
810: $this->setFolder($this->aFolder);
811: }
812:
813: if ($this->isNew() || $this->isModified()) {
814:
815: if ($this->isNew()) {
816: $this->doInsert($con);
817: } else {
818: $this->doUpdate($con);
819: }
820: $affectedRows += 1;
821: $this->resetModified();
822: }
823:
824: if ($this->documentI18nsScheduledForDeletion !== null) {
825: if (!$this->documentI18nsScheduledForDeletion->isEmpty()) {
826: DocumentI18nQuery::create()
827: ->filterByPrimaryKeys($this->documentI18nsScheduledForDeletion->getPrimaryKeys(false))
828: ->delete($con);
829: $this->documentI18nsScheduledForDeletion = null;
830: }
831: }
832:
833: if ($this->collDocumentI18ns !== null) {
834: foreach ($this->collDocumentI18ns as $referrerFK) {
835: if (!$referrerFK->isDeleted()) {
836: $affectedRows += $referrerFK->save($con);
837: }
838: }
839: }
840:
841: $this->alreadyInSave = false;
842:
843: }
844:
845: return $affectedRows;
846: }
847:
848: 849: 850: 851: 852: 853: 854: 855:
856: protected function doInsert(PropelPDO $con)
857: {
858: $modifiedColumns = array();
859: $index = 0;
860:
861: $this->modifiedColumns[] = DocumentPeer::ID;
862: if (null !== $this->id) {
863: throw new PropelException('Cannot insert a value for auto-increment primary key (' . DocumentPeer::ID . ')');
864: }
865:
866:
867: if ($this->isColumnModified(DocumentPeer::ID)) {
868: $modifiedColumns[':p' . $index++] = '`ID`';
869: }
870: if ($this->isColumnModified(DocumentPeer::PRODUCT_ID)) {
871: $modifiedColumns[':p' . $index++] = '`PRODUCT_ID`';
872: }
873: if ($this->isColumnModified(DocumentPeer::CATEGORY_ID)) {
874: $modifiedColumns[':p' . $index++] = '`CATEGORY_ID`';
875: }
876: if ($this->isColumnModified(DocumentPeer::FOLDER_ID)) {
877: $modifiedColumns[':p' . $index++] = '`FOLDER_ID`';
878: }
879: if ($this->isColumnModified(DocumentPeer::CONTENT_ID)) {
880: $modifiedColumns[':p' . $index++] = '`CONTENT_ID`';
881: }
882: if ($this->isColumnModified(DocumentPeer::FILE)) {
883: $modifiedColumns[':p' . $index++] = '`FILE`';
884: }
885: if ($this->isColumnModified(DocumentPeer::POSITION)) {
886: $modifiedColumns[':p' . $index++] = '`POSITION`';
887: }
888: if ($this->isColumnModified(DocumentPeer::CREATED_AT)) {
889: $modifiedColumns[':p' . $index++] = '`CREATED_AT`';
890: }
891: if ($this->isColumnModified(DocumentPeer::UPDATED_AT)) {
892: $modifiedColumns[':p' . $index++] = '`UPDATED_AT`';
893: }
894:
895: $sql = sprintf(
896: 'INSERT INTO `document` (%s) VALUES (%s)',
897: implode(', ', $modifiedColumns),
898: implode(', ', array_keys($modifiedColumns))
899: );
900:
901: try {
902: $stmt = $con->prepare($sql);
903: foreach ($modifiedColumns as $identifier => $columnName) {
904: switch ($columnName) {
905: case '`ID`':
906: $stmt->bindValue($identifier, $this->id, PDO::PARAM_INT);
907: break;
908: case '`PRODUCT_ID`':
909: $stmt->bindValue($identifier, $this->product_id, PDO::PARAM_INT);
910: break;
911: case '`CATEGORY_ID`':
912: $stmt->bindValue($identifier, $this->category_id, PDO::PARAM_INT);
913: break;
914: case '`FOLDER_ID`':
915: $stmt->bindValue($identifier, $this->folder_id, PDO::PARAM_INT);
916: break;
917: case '`CONTENT_ID`':
918: $stmt->bindValue($identifier, $this->content_id, PDO::PARAM_INT);
919: break;
920: case '`FILE`':
921: $stmt->bindValue($identifier, $this->file, PDO::PARAM_STR);
922: break;
923: case '`POSITION`':
924: $stmt->bindValue($identifier, $this->position, PDO::PARAM_INT);
925: break;
926: case '`CREATED_AT`':
927: $stmt->bindValue($identifier, $this->created_at, PDO::PARAM_STR);
928: break;
929: case '`UPDATED_AT`':
930: $stmt->bindValue($identifier, $this->updated_at, PDO::PARAM_STR);
931: break;
932: }
933: }
934: $stmt->execute();
935: } catch (Exception $e) {
936: Propel::log($e->getMessage(), Propel::LOG_ERR);
937: throw new PropelException(sprintf('Unable to execute INSERT statement [%s]', $sql), $e);
938: }
939:
940: try {
941: $pk = $con->lastInsertId();
942: } catch (Exception $e) {
943: throw new PropelException('Unable to get autoincrement id.', $e);
944: }
945: $this->setId($pk);
946:
947: $this->setNew(false);
948: }
949:
950: 951: 952: 953: 954: 955: 956:
957: protected function doUpdate(PropelPDO $con)
958: {
959: $selectCriteria = $this->buildPkeyCriteria();
960: $valuesCriteria = $this->buildCriteria();
961: BasePeer::doUpdate($selectCriteria, $valuesCriteria, $con);
962: }
963:
964: 965: 966: 967:
968: protected $validationFailures = array();
969:
970: 971: 972: 973: 974: 975: 976:
977: public function getValidationFailures()
978: {
979: return $this->validationFailures;
980: }
981:
982: 983: 984: 985: 986: 987: 988: 989: 990: 991: 992:
993: public function validate($columns = null)
994: {
995: $res = $this->doValidate($columns);
996: if ($res === true) {
997: $this->validationFailures = array();
998:
999: return true;
1000: } else {
1001: $this->validationFailures = $res;
1002:
1003: return false;
1004: }
1005: }
1006:
1007: 1008: 1009: 1010: 1011: 1012: 1013: 1014: 1015: 1016:
1017: protected function doValidate($columns = null)
1018: {
1019: if (!$this->alreadyInValidation) {
1020: $this->alreadyInValidation = true;
1021: $retval = null;
1022:
1023: $failureMap = array();
1024:
1025:
1026:
1027:
1028:
1029:
1030:
1031: if ($this->aProduct !== null) {
1032: if (!$this->aProduct->validate($columns)) {
1033: $failureMap = array_merge($failureMap, $this->aProduct->getValidationFailures());
1034: }
1035: }
1036:
1037: if ($this->aCategory !== null) {
1038: if (!$this->aCategory->validate($columns)) {
1039: $failureMap = array_merge($failureMap, $this->aCategory->getValidationFailures());
1040: }
1041: }
1042:
1043: if ($this->aContent !== null) {
1044: if (!$this->aContent->validate($columns)) {
1045: $failureMap = array_merge($failureMap, $this->aContent->getValidationFailures());
1046: }
1047: }
1048:
1049: if ($this->aFolder !== null) {
1050: if (!$this->aFolder->validate($columns)) {
1051: $failureMap = array_merge($failureMap, $this->aFolder->getValidationFailures());
1052: }
1053: }
1054:
1055:
1056: if (($retval = DocumentPeer::doValidate($this, $columns)) !== true) {
1057: $failureMap = array_merge($failureMap, $retval);
1058: }
1059:
1060:
1061: if ($this->collDocumentI18ns !== null) {
1062: foreach ($this->collDocumentI18ns as $referrerFK) {
1063: if (!$referrerFK->validate($columns)) {
1064: $failureMap = array_merge($failureMap, $referrerFK->getValidationFailures());
1065: }
1066: }
1067: }
1068:
1069:
1070: $this->alreadyInValidation = false;
1071: }
1072:
1073: return (!empty($failureMap) ? $failureMap : true);
1074: }
1075:
1076: 1077: 1078: 1079: 1080: 1081: 1082: 1083: 1084: 1085:
1086: public function getByName($name, $type = BasePeer::TYPE_PHPNAME)
1087: {
1088: $pos = DocumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
1089: $field = $this->getByPosition($pos);
1090:
1091: return $field;
1092: }
1093:
1094: 1095: 1096: 1097: 1098: 1099: 1100:
1101: public function getByPosition($pos)
1102: {
1103: switch ($pos) {
1104: case 0:
1105: return $this->getId();
1106: break;
1107: case 1:
1108: return $this->getProductId();
1109: break;
1110: case 2:
1111: return $this->getCategoryId();
1112: break;
1113: case 3:
1114: return $this->getFolderId();
1115: break;
1116: case 4:
1117: return $this->getContentId();
1118: break;
1119: case 5:
1120: return $this->getFile();
1121: break;
1122: case 6:
1123: return $this->getPosition();
1124: break;
1125: case 7:
1126: return $this->getCreatedAt();
1127: break;
1128: case 8:
1129: return $this->getUpdatedAt();
1130: break;
1131: default:
1132: return null;
1133: break;
1134: }
1135: }
1136:
1137: 1138: 1139: 1140: 1141: 1142: 1143: 1144: 1145: 1146: 1147: 1148: 1149: 1150: 1151:
1152: public function toArray($keyType = BasePeer::TYPE_PHPNAME, $includeLazyLoadColumns = true, $alreadyDumpedObjects = array(), $includeForeignObjects = false)
1153: {
1154: if (isset($alreadyDumpedObjects['Document'][$this->getPrimaryKey()])) {
1155: return '*RECURSION*';
1156: }
1157: $alreadyDumpedObjects['Document'][$this->getPrimaryKey()] = true;
1158: $keys = DocumentPeer::getFieldNames($keyType);
1159: $result = array(
1160: $keys[0] => $this->getId(),
1161: $keys[1] => $this->getProductId(),
1162: $keys[2] => $this->getCategoryId(),
1163: $keys[3] => $this->getFolderId(),
1164: $keys[4] => $this->getContentId(),
1165: $keys[5] => $this->getFile(),
1166: $keys[6] => $this->getPosition(),
1167: $keys[7] => $this->getCreatedAt(),
1168: $keys[8] => $this->getUpdatedAt(),
1169: );
1170: if ($includeForeignObjects) {
1171: if (null !== $this->aProduct) {
1172: $result['Product'] = $this->aProduct->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
1173: }
1174: if (null !== $this->aCategory) {
1175: $result['Category'] = $this->aCategory->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
1176: }
1177: if (null !== $this->aContent) {
1178: $result['Content'] = $this->aContent->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
1179: }
1180: if (null !== $this->aFolder) {
1181: $result['Folder'] = $this->aFolder->toArray($keyType, $includeLazyLoadColumns, $alreadyDumpedObjects, true);
1182: }
1183: if (null !== $this->collDocumentI18ns) {
1184: $result['DocumentI18ns'] = $this->collDocumentI18ns->toArray(null, true, $keyType, $includeLazyLoadColumns, $alreadyDumpedObjects);
1185: }
1186: }
1187:
1188: return $result;
1189: }
1190:
1191: 1192: 1193: 1194: 1195: 1196: 1197: 1198: 1199: 1200: 1201:
1202: public function setByName($name, $value, $type = BasePeer::TYPE_PHPNAME)
1203: {
1204: $pos = DocumentPeer::translateFieldName($name, $type, BasePeer::TYPE_NUM);
1205:
1206: $this->setByPosition($pos, $value);
1207: }
1208:
1209: 1210: 1211: 1212: 1213: 1214: 1215: 1216:
1217: public function setByPosition($pos, $value)
1218: {
1219: switch ($pos) {
1220: case 0:
1221: $this->setId($value);
1222: break;
1223: case 1:
1224: $this->setProductId($value);
1225: break;
1226: case 2:
1227: $this->setCategoryId($value);
1228: break;
1229: case 3:
1230: $this->setFolderId($value);
1231: break;
1232: case 4:
1233: $this->setContentId($value);
1234: break;
1235: case 5:
1236: $this->setFile($value);
1237: break;
1238: case 6:
1239: $this->setPosition($value);
1240: break;
1241: case 7:
1242: $this->setCreatedAt($value);
1243: break;
1244: case 8:
1245: $this->setUpdatedAt($value);
1246: break;
1247: }
1248: }
1249:
1250: 1251: 1252: 1253: 1254: 1255: 1256: 1257: 1258: 1259: 1260: 1261: 1262: 1263: 1264: 1265: 1266:
1267: public function fromArray($arr, $keyType = BasePeer::TYPE_PHPNAME)
1268: {
1269: $keys = DocumentPeer::getFieldNames($keyType);
1270:
1271: if (array_key_exists($keys[0], $arr)) $this->setId($arr[$keys[0]]);
1272: if (array_key_exists($keys[1], $arr)) $this->setProductId($arr[$keys[1]]);
1273: if (array_key_exists($keys[2], $arr)) $this->setCategoryId($arr[$keys[2]]);
1274: if (array_key_exists($keys[3], $arr)) $this->setFolderId($arr[$keys[3]]);
1275: if (array_key_exists($keys[4], $arr)) $this->setContentId($arr[$keys[4]]);
1276: if (array_key_exists($keys[5], $arr)) $this->setFile($arr[$keys[5]]);
1277: if (array_key_exists($keys[6], $arr)) $this->setPosition($arr[$keys[6]]);
1278: if (array_key_exists($keys[7], $arr)) $this->setCreatedAt($arr[$keys[7]]);
1279: if (array_key_exists($keys[8], $arr)) $this->setUpdatedAt($arr[$keys[8]]);
1280: }
1281:
1282: 1283: 1284: 1285: 1286:
1287: public function buildCriteria()
1288: {
1289: $criteria = new Criteria(DocumentPeer::DATABASE_NAME);
1290:
1291: if ($this->isColumnModified(DocumentPeer::ID)) $criteria->add(DocumentPeer::ID, $this->id);
1292: if ($this->isColumnModified(DocumentPeer::PRODUCT_ID)) $criteria->add(DocumentPeer::PRODUCT_ID, $this->product_id);
1293: if ($this->isColumnModified(DocumentPeer::CATEGORY_ID)) $criteria->add(DocumentPeer::CATEGORY_ID, $this->category_id);
1294: if ($this->isColumnModified(DocumentPeer::FOLDER_ID)) $criteria->add(DocumentPeer::FOLDER_ID, $this->folder_id);
1295: if ($this->isColumnModified(DocumentPeer::CONTENT_ID)) $criteria->add(DocumentPeer::CONTENT_ID, $this->content_id);
1296: if ($this->isColumnModified(DocumentPeer::FILE)) $criteria->add(DocumentPeer::FILE, $this->file);
1297: if ($this->isColumnModified(DocumentPeer::POSITION)) $criteria->add(DocumentPeer::POSITION, $this->position);
1298: if ($this->isColumnModified(DocumentPeer::CREATED_AT)) $criteria->add(DocumentPeer::CREATED_AT, $this->created_at);
1299: if ($this->isColumnModified(DocumentPeer::UPDATED_AT)) $criteria->add(DocumentPeer::UPDATED_AT, $this->updated_at);
1300:
1301: return $criteria;
1302: }
1303:
1304: 1305: 1306: 1307: 1308: 1309: 1310: 1311:
1312: public function buildPkeyCriteria()
1313: {
1314: $criteria = new Criteria(DocumentPeer::DATABASE_NAME);
1315: $criteria->add(DocumentPeer::ID, $this->id);
1316:
1317: return $criteria;
1318: }
1319:
1320: 1321: 1322: 1323:
1324: public function getPrimaryKey()
1325: {
1326: return $this->getId();
1327: }
1328:
1329: 1330: 1331: 1332: 1333: 1334:
1335: public function setPrimaryKey($key)
1336: {
1337: $this->setId($key);
1338: }
1339:
1340: 1341: 1342: 1343:
1344: public function isPrimaryKeyNull()
1345: {
1346:
1347: return null === $this->getId();
1348: }
1349:
1350: 1351: 1352: 1353: 1354: 1355: 1356: 1357: 1358: 1359: 1360:
1361: public function copyInto($copyObj, $deepCopy = false, $makeNew = true)
1362: {
1363: $copyObj->setProductId($this->getProductId());
1364: $copyObj->setCategoryId($this->getCategoryId());
1365: $copyObj->setFolderId($this->getFolderId());
1366: $copyObj->setContentId($this->getContentId());
1367: $copyObj->setFile($this->getFile());
1368: $copyObj->setPosition($this->getPosition());
1369: $copyObj->setCreatedAt($this->getCreatedAt());
1370: $copyObj->setUpdatedAt($this->getUpdatedAt());
1371:
1372: if ($deepCopy && !$this->startCopy) {
1373:
1374:
1375: $copyObj->setNew(false);
1376:
1377: $this->startCopy = true;
1378:
1379: foreach ($this->getDocumentI18ns() as $relObj) {
1380: if ($relObj !== $this) {
1381: $copyObj->addDocumentI18n($relObj->copy($deepCopy));
1382: }
1383: }
1384:
1385:
1386: $this->startCopy = false;
1387: }
1388:
1389: if ($makeNew) {
1390: $copyObj->setNew(true);
1391: $copyObj->setId(NULL);
1392: }
1393: }
1394:
1395: 1396: 1397: 1398: 1399: 1400: 1401: 1402: 1403: 1404: 1405: 1406:
1407: public function copy($deepCopy = false)
1408: {
1409:
1410: $clazz = get_class($this);
1411: $copyObj = new $clazz();
1412: $this->copyInto($copyObj, $deepCopy);
1413:
1414: return $copyObj;
1415: }
1416:
1417: 1418: 1419: 1420: 1421: 1422: 1423: 1424: 1425:
1426: public function getPeer()
1427: {
1428: if (self::$peer === null) {
1429: self::$peer = new DocumentPeer();
1430: }
1431:
1432: return self::$peer;
1433: }
1434:
1435: 1436: 1437: 1438: 1439: 1440: 1441:
1442: public function setProduct(Product $v = null)
1443: {
1444: if ($v === null) {
1445: $this->setProductId(NULL);
1446: } else {
1447: $this->setProductId($v->getId());
1448: }
1449:
1450: $this->aProduct = $v;
1451:
1452:
1453:
1454: if ($v !== null) {
1455: $v->addDocument($this);
1456: }
1457:
1458:
1459: return $this;
1460: }
1461:
1462:
1463: 1464: 1465: 1466: 1467: 1468: 1469:
1470: public function getProduct(PropelPDO $con = null)
1471: {
1472: if ($this->aProduct === null && ($this->product_id !== null)) {
1473: $this->aProduct = ProductQuery::create()->findPk($this->product_id, $con);
1474: 1475: 1476: 1477: 1478: 1479: 1480:
1481: }
1482:
1483: return $this->aProduct;
1484: }
1485:
1486: 1487: 1488: 1489: 1490: 1491: 1492:
1493: public function setCategory(Category $v = null)
1494: {
1495: if ($v === null) {
1496: $this->setCategoryId(NULL);
1497: } else {
1498: $this->setCategoryId($v->getId());
1499: }
1500:
1501: $this->aCategory = $v;
1502:
1503:
1504:
1505: if ($v !== null) {
1506: $v->addDocument($this);
1507: }
1508:
1509:
1510: return $this;
1511: }
1512:
1513:
1514: 1515: 1516: 1517: 1518: 1519: 1520:
1521: public function getCategory(PropelPDO $con = null)
1522: {
1523: if ($this->aCategory === null && ($this->category_id !== null)) {
1524: $this->aCategory = CategoryQuery::create()->findPk($this->category_id, $con);
1525: 1526: 1527: 1528: 1529: 1530: 1531:
1532: }
1533:
1534: return $this->aCategory;
1535: }
1536:
1537: 1538: 1539: 1540: 1541: 1542: 1543:
1544: public function setContent(Content $v = null)
1545: {
1546: if ($v === null) {
1547: $this->setContentId(NULL);
1548: } else {
1549: $this->setContentId($v->getId());
1550: }
1551:
1552: $this->aContent = $v;
1553:
1554:
1555:
1556: if ($v !== null) {
1557: $v->addDocument($this);
1558: }
1559:
1560:
1561: return $this;
1562: }
1563:
1564:
1565: 1566: 1567: 1568: 1569: 1570: 1571:
1572: public function getContent(PropelPDO $con = null)
1573: {
1574: if ($this->aContent === null && ($this->content_id !== null)) {
1575: $this->aContent = ContentQuery::create()->findPk($this->content_id, $con);
1576: 1577: 1578: 1579: 1580: 1581: 1582:
1583: }
1584:
1585: return $this->aContent;
1586: }
1587:
1588: 1589: 1590: 1591: 1592: 1593: 1594:
1595: public function setFolder(Folder $v = null)
1596: {
1597: if ($v === null) {
1598: $this->setFolderId(NULL);
1599: } else {
1600: $this->setFolderId($v->getId());
1601: }
1602:
1603: $this->aFolder = $v;
1604:
1605:
1606:
1607: if ($v !== null) {
1608: $v->addDocument($this);
1609: }
1610:
1611:
1612: return $this;
1613: }
1614:
1615:
1616: 1617: 1618: 1619: 1620: 1621: 1622:
1623: public function getFolder(PropelPDO $con = null)
1624: {
1625: if ($this->aFolder === null && ($this->folder_id !== null)) {
1626: $this->aFolder = FolderQuery::create()->findPk($this->folder_id, $con);
1627: 1628: 1629: 1630: 1631: 1632: 1633:
1634: }
1635:
1636: return $this->aFolder;
1637: }
1638:
1639:
1640: 1641: 1642: 1643: 1644: 1645: 1646: 1647:
1648: public function initRelation($relationName)
1649: {
1650: if ('DocumentI18n' == $relationName) {
1651: $this->initDocumentI18ns();
1652: }
1653: }
1654:
1655: 1656: 1657: 1658: 1659: 1660: 1661: 1662: 1663:
1664: public function clearDocumentI18ns()
1665: {
1666: $this->collDocumentI18ns = null;
1667: $this->collDocumentI18nsPartial = null;
1668: }
1669:
1670: 1671: 1672: 1673: 1674:
1675: public function resetPartialDocumentI18ns($v = true)
1676: {
1677: $this->collDocumentI18nsPartial = $v;
1678: }
1679:
1680: 1681: 1682: 1683: 1684: 1685: 1686: 1687: 1688: 1689: 1690: 1691:
1692: public function initDocumentI18ns($overrideExisting = true)
1693: {
1694: if (null !== $this->collDocumentI18ns && !$overrideExisting) {
1695: return;
1696: }
1697: $this->collDocumentI18ns = new PropelObjectCollection();
1698: $this->collDocumentI18ns->setModel('DocumentI18n');
1699: }
1700:
1701: 1702: 1703: 1704: 1705: 1706: 1707: 1708: 1709: 1710: 1711: 1712: 1713: 1714:
1715: public function getDocumentI18ns($criteria = null, PropelPDO $con = null)
1716: {
1717: $partial = $this->collDocumentI18nsPartial && !$this->isNew();
1718: if (null === $this->collDocumentI18ns || null !== $criteria || $partial) {
1719: if ($this->isNew() && null === $this->collDocumentI18ns) {
1720:
1721: $this->initDocumentI18ns();
1722: } else {
1723: $collDocumentI18ns = DocumentI18nQuery::create(null, $criteria)
1724: ->filterByDocument($this)
1725: ->find($con);
1726: if (null !== $criteria) {
1727: if (false !== $this->collDocumentI18nsPartial && count($collDocumentI18ns)) {
1728: $this->initDocumentI18ns(false);
1729:
1730: foreach($collDocumentI18ns as $obj) {
1731: if (false == $this->collDocumentI18ns->contains($obj)) {
1732: $this->collDocumentI18ns->append($obj);
1733: }
1734: }
1735:
1736: $this->collDocumentI18nsPartial = true;
1737: }
1738:
1739: return $collDocumentI18ns;
1740: }
1741:
1742: if($partial && $this->collDocumentI18ns) {
1743: foreach($this->collDocumentI18ns as $obj) {
1744: if($obj->isNew()) {
1745: $collDocumentI18ns[] = $obj;
1746: }
1747: }
1748: }
1749:
1750: $this->collDocumentI18ns = $collDocumentI18ns;
1751: $this->collDocumentI18nsPartial = false;
1752: }
1753: }
1754:
1755: return $this->collDocumentI18ns;
1756: }
1757:
1758: 1759: 1760: 1761: 1762: 1763: 1764: 1765: 1766:
1767: public function setDocumentI18ns(PropelCollection $documentI18ns, PropelPDO $con = null)
1768: {
1769: $this->documentI18nsScheduledForDeletion = $this->getDocumentI18ns(new Criteria(), $con)->diff($documentI18ns);
1770:
1771: foreach ($this->documentI18nsScheduledForDeletion as $documentI18nRemoved) {
1772: $documentI18nRemoved->setDocument(null);
1773: }
1774:
1775: $this->collDocumentI18ns = null;
1776: foreach ($documentI18ns as $documentI18n) {
1777: $this->addDocumentI18n($documentI18n);
1778: }
1779:
1780: $this->collDocumentI18ns = $documentI18ns;
1781: $this->collDocumentI18nsPartial = false;
1782: }
1783:
1784: 1785: 1786: 1787: 1788: 1789: 1790: 1791: 1792:
1793: public function countDocumentI18ns(Criteria $criteria = null, $distinct = false, PropelPDO $con = null)
1794: {
1795: $partial = $this->collDocumentI18nsPartial && !$this->isNew();
1796: if (null === $this->collDocumentI18ns || null !== $criteria || $partial) {
1797: if ($this->isNew() && null === $this->collDocumentI18ns) {
1798: return 0;
1799: } else {
1800: if($partial && !$criteria) {
1801: return count($this->getDocumentI18ns());
1802: }
1803: $query = DocumentI18nQuery::create(null, $criteria);
1804: if ($distinct) {
1805: $query->distinct();
1806: }
1807:
1808: return $query
1809: ->filterByDocument($this)
1810: ->count($con);
1811: }
1812: } else {
1813: return count($this->collDocumentI18ns);
1814: }
1815: }
1816:
1817: 1818: 1819: 1820: 1821: 1822: 1823:
1824: public function addDocumentI18n(DocumentI18n $l)
1825: {
1826: if ($l && $locale = $l->getLocale()) {
1827: $this->setLocale($locale);
1828: $this->currentTranslations[$locale] = $l;
1829: }
1830: if ($this->collDocumentI18ns === null) {
1831: $this->initDocumentI18ns();
1832: $this->collDocumentI18nsPartial = true;
1833: }
1834: if (!$this->collDocumentI18ns->contains($l)) {
1835: $this->doAddDocumentI18n($l);
1836: }
1837:
1838: return $this;
1839: }
1840:
1841: 1842: 1843:
1844: protected function doAddDocumentI18n($documentI18n)
1845: {
1846: $this->collDocumentI18ns[]= $documentI18n;
1847: $documentI18n->setDocument($this);
1848: }
1849:
1850: 1851: 1852:
1853: public function removeDocumentI18n($documentI18n)
1854: {
1855: if ($this->getDocumentI18ns()->contains($documentI18n)) {
1856: $this->collDocumentI18ns->remove($this->collDocumentI18ns->search($documentI18n));
1857: if (null === $this->documentI18nsScheduledForDeletion) {
1858: $this->documentI18nsScheduledForDeletion = clone $this->collDocumentI18ns;
1859: $this->documentI18nsScheduledForDeletion->clear();
1860: }
1861: $this->documentI18nsScheduledForDeletion[]= $documentI18n;
1862: $documentI18n->setDocument(null);
1863: }
1864: }
1865:
1866: 1867: 1868:
1869: public function clear()
1870: {
1871: $this->id = null;
1872: $this->product_id = null;
1873: $this->category_id = null;
1874: $this->folder_id = null;
1875: $this->content_id = null;
1876: $this->file = null;
1877: $this->position = null;
1878: $this->created_at = null;
1879: $this->updated_at = null;
1880: $this->alreadyInSave = false;
1881: $this->alreadyInValidation = false;
1882: $this->clearAllReferences();
1883: $this->resetModified();
1884: $this->setNew(true);
1885: $this->setDeleted(false);
1886: }
1887:
1888: 1889: 1890: 1891: 1892: 1893: 1894: 1895: 1896:
1897: public function clearAllReferences($deep = false)
1898: {
1899: if ($deep) {
1900: if ($this->collDocumentI18ns) {
1901: foreach ($this->collDocumentI18ns as $o) {
1902: $o->clearAllReferences($deep);
1903: }
1904: }
1905: }
1906:
1907:
1908: $this->currentLocale = 'en_EN';
1909: $this->currentTranslations = null;
1910:
1911: if ($this->collDocumentI18ns instanceof PropelCollection) {
1912: $this->collDocumentI18ns->clearIterator();
1913: }
1914: $this->collDocumentI18ns = null;
1915: $this->aProduct = null;
1916: $this->aCategory = null;
1917: $this->aContent = null;
1918: $this->aFolder = null;
1919: }
1920:
1921: 1922: 1923: 1924: 1925:
1926: public function __toString()
1927: {
1928: return (string) $this->exportTo(DocumentPeer::DEFAULT_STRING_FORMAT);
1929: }
1930:
1931: 1932: 1933: 1934: 1935:
1936: public function isAlreadyInSave()
1937: {
1938: return $this->alreadyInSave;
1939: }
1940:
1941:
1942:
1943: 1944: 1945: 1946: 1947:
1948: public function keepUpdateDateUnchanged()
1949: {
1950: $this->modifiedColumns[] = DocumentPeer::UPDATED_AT;
1951:
1952: return $this;
1953: }
1954:
1955:
1956:
1957: 1958: 1959: 1960: 1961: 1962: 1963:
1964: public function setLocale($locale = 'en_EN')
1965: {
1966: $this->currentLocale = $locale;
1967:
1968: return $this;
1969: }
1970:
1971: 1972: 1973: 1974: 1975:
1976: public function getLocale()
1977: {
1978: return $this->currentLocale;
1979: }
1980:
1981: 1982: 1983: 1984: 1985: 1986: 1987:
1988: public function getTranslation($locale = 'en_EN', PropelPDO $con = null)
1989: {
1990: if (!isset($this->currentTranslations[$locale])) {
1991: if (null !== $this->collDocumentI18ns) {
1992: foreach ($this->collDocumentI18ns as $translation) {
1993: if ($translation->getLocale() == $locale) {
1994: $this->currentTranslations[$locale] = $translation;
1995:
1996: return $translation;
1997: }
1998: }
1999: }
2000: if ($this->isNew()) {
2001: $translation = new DocumentI18n();
2002: $translation->setLocale($locale);
2003: } else {
2004: $translation = DocumentI18nQuery::create()
2005: ->filterByPrimaryKey(array($this->getPrimaryKey(), $locale))
2006: ->findOneOrCreate($con);
2007: $this->currentTranslations[$locale] = $translation;
2008: }
2009: $this->addDocumentI18n($translation);
2010: }
2011:
2012: return $this->currentTranslations[$locale];
2013: }
2014:
2015: 2016: 2017: 2018: 2019: 2020: 2021: 2022:
2023: public function removeTranslation($locale = 'en_EN', PropelPDO $con = null)
2024: {
2025: if (!$this->isNew()) {
2026: DocumentI18nQuery::create()
2027: ->filterByPrimaryKey(array($this->getPrimaryKey(), $locale))
2028: ->delete($con);
2029: }
2030: if (isset($this->currentTranslations[$locale])) {
2031: unset($this->currentTranslations[$locale]);
2032: }
2033: foreach ($this->collDocumentI18ns as $key => $translation) {
2034: if ($translation->getLocale() == $locale) {
2035: unset($this->collDocumentI18ns[$key]);
2036: break;
2037: }
2038: }
2039:
2040: return $this;
2041: }
2042:
2043: 2044: 2045: 2046: 2047: 2048:
2049: public function getCurrentTranslation(PropelPDO $con = null)
2050: {
2051: return $this->getTranslation($this->getLocale(), $con);
2052: }
2053:
2054:
2055: 2056: 2057: 2058: 2059:
2060: public function getTitle()
2061: {
2062: return $this->getCurrentTranslation()->getTitle();
2063: }
2064:
2065:
2066: 2067: 2068: 2069: 2070: 2071:
2072: public function setTitle($v)
2073: { $this->getCurrentTranslation()->setTitle($v);
2074:
2075: return $this;
2076: }
2077:
2078:
2079: 2080: 2081: 2082: 2083:
2084: public function getDescription()
2085: {
2086: return $this->getCurrentTranslation()->getDescription();
2087: }
2088:
2089:
2090: 2091: 2092: 2093: 2094: 2095:
2096: public function setDescription($v)
2097: { $this->getCurrentTranslation()->setDescription($v);
2098:
2099: return $this;
2100: }
2101:
2102:
2103: 2104: 2105: 2106: 2107:
2108: public function getChapo()
2109: {
2110: return $this->getCurrentTranslation()->getChapo();
2111: }
2112:
2113:
2114: 2115: 2116: 2117: 2118: 2119:
2120: public function setChapo($v)
2121: { $this->getCurrentTranslation()->setChapo($v);
2122:
2123: return $this;
2124: }
2125:
2126:
2127: 2128: 2129: 2130: 2131:
2132: public function getPostscriptum()
2133: {
2134: return $this->getCurrentTranslation()->getPostscriptum();
2135: }
2136:
2137:
2138: 2139: 2140: 2141: 2142: 2143:
2144: public function setPostscriptum($v)
2145: { $this->getCurrentTranslation()->setPostscriptum($v);
2146:
2147: return $this;
2148: }
2149:
2150: }
2151: