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