/**
  * Returns a peer instance associated with this om.
  *
  * Since Peer classes are not to have any instance attributes, this method returns the
  * same instance for all member of this class. The method could therefore
  * be static, but this would prevent one from overriding the behavior.
  *
  * @return     PartnerPeer
  */
 public function getPeer()
 {
     if (self::$peer === null) {
         self::$peer = new PartnerPeer();
     }
     return self::$peer;
 }
示例#2
0
文件: Partner.php 项目: panigh/server
 public function postUpdate(PropelPDO $con = null)
 {
     if ($this->alreadyInSave) {
         return parent::postUpdate($con);
     }
     // update the owner kuser deatils if required
     $adminNameModified = $this->isColumnModified(PartnerPeer::ADMIN_NAME);
     $adminEmailModified = $this->isColumnModified(PartnerPeer::ADMIN_EMAIL);
     if ($adminNameModified || $adminEmailModified) {
         $ownerKuserId = $this->getAccountOwnerKuserId();
         if ($ownerKuserId) {
             $ownerKuser = kuserPeer::retrieveByPK($ownerKuserId);
             if ($adminNameModified) {
                 $ownerKuser->setFullName($this->getAdminName());
             }
             if ($adminEmailModified) {
                 $ownerKuser->setEmail($this->getAdminEmail());
             }
             $ownerKuser->save();
         }
     }
     $objectDeleted = false;
     if ($this->isColumnModified(PartnerPeer::STATUS) && $this->getStatus() == Partner::PARTNER_STATUS_DELETED) {
         $objectDeleted = true;
     }
     $ret = parent::postUpdate($con);
     if ($objectDeleted) {
         kEventsManager::raiseEvent(new kObjectDeletedEvent($this));
     }
     return $ret;
 }
示例#3
0
 public function postUpdate(PropelPDO $con = null)
 {
     // update the owner kuser deatils if required
     $adminNameModified = $this->isColumnModified(PartnerPeer::ADMIN_NAME);
     $adminEmailModified = $this->isColumnModified(PartnerPeer::ADMIN_EMAIL);
     if ($adminNameModified || $adminEmailModified) {
         $ownerKuserId = $this->getAccountOwnerKuserId();
         if ($ownerKuserId) {
             $ownerKuser = kuserPeer::retrieveByPK($ownerKuserId);
             if ($adminNameModified) {
                 $ownerKuser->setFullName($this->getAdminName());
             }
             if ($adminEmailModified) {
                 $ownerKuser->setEmail($this->getAdminEmail());
             }
             $ownerKuser->save();
         }
     }
     return parent::postUpdate($con);
 }