Example #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 EnumItem (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->setId($this->id);
     $copyObj->setParentId($this->parent_id);
     $copyObj->setDescr($this->descr);
     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->getCourseTypeAssociations() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addCourseTypeAssociation($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getEnumItemsRelatedByParentId() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addEnumItemRelatedByParentId($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getExams() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addExam($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getImportMappingsRelatedByImportFileType() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addImportMappingRelatedByImportFileType($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getImportMappingsRelatedByMapping() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addImportMappingRelatedByMapping($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getRatingFields() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addRatingField($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getUsers() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addUser($relObj->copy($deepCopy));
             }
         }
     }
     // if ($deepCopy)
     $copyObj->setNew(true);
 }
Example #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 Course (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->setId($this->id);
     $copyObj->setDeptId($this->dept_id);
     $copyObj->setDescr($this->descr);
     $copyObj->setIsEng($this->is_eng);
     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->getCourseComments() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addCourseComment($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getCourseDetails() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addCourseDetail($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getCourseInstructorAssociations() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addCourseInstructorAssociation($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getCourseDisciplineAssociations() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addCourseDisciplineAssociation($relObj->copy($deepCopy));
             }
         }
         foreach ($this->getExams() as $relObj) {
             if ($relObj !== $this) {
                 // ensure that we don't try to copy a reference to ourselves
                 $copyObj->addExam($relObj->copy($deepCopy));
             }
         }
     }
     // if ($deepCopy)
     $copyObj->setNew(true);
 }