@@ 770-804 (lines=35) @@ | ||
767 | * @throws PropelException |
|
768 | * @see save() |
|
769 | */ |
|
770 | protected function doSave(ConnectionInterface $con) |
|
771 | { |
|
772 | $affectedRows = 0; // initialize var to track total num of affected rows |
|
773 | if (!$this->alreadyInSave) { |
|
774 | $this->alreadyInSave = true; |
|
775 | ||
776 | // We call the save method on the following object(s) if they |
|
777 | // were passed to this object by their corresponding set |
|
778 | // method. This object relates to these object(s) by a |
|
779 | // foreign key reference. |
|
780 | ||
781 | if ($this->aBannerImage !== null) { |
|
782 | if ($this->aBannerImage->isModified() || $this->aBannerImage->isNew()) { |
|
783 | $affectedRows += $this->aBannerImage->save($con); |
|
784 | } |
|
785 | $this->setBannerImage($this->aBannerImage); |
|
786 | } |
|
787 | ||
788 | if ($this->isNew() || $this->isModified()) { |
|
789 | // persist changes |
|
790 | if ($this->isNew()) { |
|
791 | $this->doInsert($con); |
|
792 | $affectedRows += 1; |
|
793 | } else { |
|
794 | $affectedRows += $this->doUpdate($con); |
|
795 | } |
|
796 | $this->resetModified(); |
|
797 | } |
|
798 | ||
799 | $this->alreadyInSave = false; |
|
800 | ||
801 | } |
|
802 | ||
803 | return $affectedRows; |
|
804 | } // doSave() |
|
805 | ||
806 | /** |
|
807 | * Insert the row in the database. |
@@ 650-684 (lines=35) @@ | ||
647 | * @throws PropelException |
|
648 | * @see save() |
|
649 | */ |
|
650 | protected function doSave(ConnectionInterface $con) |
|
651 | { |
|
652 | $affectedRows = 0; // initialize var to track total num of affected rows |
|
653 | if (!$this->alreadyInSave) { |
|
654 | $this->alreadyInSave = true; |
|
655 | ||
656 | // We call the save method on the following object(s) if they |
|
657 | // were passed to this object by their corresponding set |
|
658 | // method. This object relates to these object(s) by a |
|
659 | // foreign key reference. |
|
660 | ||
661 | if ($this->aBanners !== null) { |
|
662 | if ($this->aBanners->isModified() || $this->aBanners->isNew()) { |
|
663 | $affectedRows += $this->aBanners->save($con); |
|
664 | } |
|
665 | $this->setBanners($this->aBanners); |
|
666 | } |
|
667 | ||
668 | if ($this->isNew() || $this->isModified()) { |
|
669 | // persist changes |
|
670 | if ($this->isNew()) { |
|
671 | $this->doInsert($con); |
|
672 | $affectedRows += 1; |
|
673 | } else { |
|
674 | $affectedRows += $this->doUpdate($con); |
|
675 | } |
|
676 | $this->resetModified(); |
|
677 | } |
|
678 | ||
679 | $this->alreadyInSave = false; |
|
680 | ||
681 | } |
|
682 | ||
683 | return $affectedRows; |
|
684 | } // doSave() |
|
685 | ||
686 | /** |
|
687 | * Insert the row in the database. |