Ejemplo n.º 1
0
 /**
  * Sets contents of passed object to values from current object.
  *
  * If desired, this method can also make copies of all associated (fkey referrers)
  * objects.
  *
  * @param      object $copyObj An object of User (or compatible) type.
  * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  * @throws     PropelException
  */
 public function copyInto($copyObj, $deepCopy = false)
 {
     $copyObj->setLogin($this->login);
     $copyObj->setPasswordHash($this->password_hash);
     $copyObj->setFamilyName($this->family_name);
     $copyObj->setSurname($this->surname);
     $copyObj->setIsActive($this->is_active);
     $copyObj->setCardNumber($this->card_number);
     $copyObj->setBirthdate($this->birthdate);
     $copyObj->setIsMember($this->is_member);
     $copyObj->setEmailAddress($this->email_address);
     $copyObj->setAddress($this->address);
     $copyObj->setPhoneNumber($this->phone_number);
     $copyObj->setCreatedAt($this->created_at);
     $copyObj->setPhotograph($this->photograph);
     if ($deepCopy) {
         // important: temporarily setNew(false) because this affects the behavior of
         // the getter/setter methods for fkey referrer objects.
         $copyObj->setNew(false);
         foreach ($this->getMessagesRelatedByRecipientId() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addMessageRelatedByRecipientId($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getMessagesRelatedBySenderId() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addMessageRelatedBySenderId($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getMessagesRelatedByOwnerId() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addMessageRelatedByOwnerId($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getReservations() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addReservation($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getReservationOtherMemberss() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addReservationOtherMembers($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getSubscriptions() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addSubscription($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getUsergroupHasChiefs() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addUsergroupHasChief($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getUsergroupHasUsers() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addUsergroupHasUser($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getUserHasRoles() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addUserHasRole($relObj->copy($deepCopy));
             }
         }
     }
     // if ($deepCopy)
     $copyObj->setNew(true);
     $copyObj->setId(NULL);
     // this is a auto-increment column, so set to default value
 }
Ejemplo n.º 2
0
 /**
  * Sets contents of passed object to values from current object.
  *
  * If desired, this method can also make copies of all associated (fkey referrers)
  * objects.
  *
  * @param      object $copyObj An object of Usergroup (or compatible) type.
  * @param      boolean $deepCopy Whether to also copy all rows that refer (by fkey) to the current row.
  * @throws     PropelException
  */
 public function copyInto($copyObj, $deepCopy = false)
 {
     $copyObj->setName($this->name);
     if ($deepCopy) {
         // important: temporarily setNew(false) because this affects the behavior of
         // the getter/setter methods for fkey referrer objects.
         $copyObj->setNew(false);
         foreach ($this->getReservations() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addReservation($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getSubscriptions() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addSubscription($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getUsergroupHasActivitys() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addUsergroupHasActivity($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getUsergroupHasChiefs() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addUsergroupHasChief($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getUsergroupHasUsers() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addUsergroupHasUser($relObj->copy($deepCopy));
             }
         }
     }
     // if ($deepCopy)
     $copyObj->setNew(true);
     $copyObj->setId(NULL);
     // this is a auto-increment column, so set to default value
 }