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