Browse Source

Correction de la relation Track/Learner

Mael ETIENNE 3 years ago
parent
commit
5b4815da95

+ 28
- 0
Entity/Scorm2004/Scorm2004Track.php View File

@@ -96,6 +96,11 @@ class Scorm2004Track
96 96
      */
97 97
     protected $registrationAttempt;
98 98
 
99
+    /**
100
+     * @var Logipro\Bundle\SCORMBundle\Entity\Learner
101
+     */
102
+    protected $learner;
103
+
99 104
     /**
100 105
      *
101 106
      * @var ArrayCollection
@@ -490,6 +495,29 @@ class Scorm2004Track
490 495
         return $this->registrationAttempt;
491 496
     }
492 497
 
498
+    /**
499
+     * Set Learner entity (many to one).
500
+     *
501
+     * @param Logipro\Bundle\SCORMBundle\Entity\Learner $learner
502
+     * @return \Logipro\Bundle\SCORMBundle\Entity\Scorm2004\Scorm2004Track
503
+     */
504
+    public function setLearner(Learner $learner)
505
+    {
506
+        $this->learner = $learner;
507
+
508
+        return $this;
509
+    }
510
+
511
+    /**
512
+     * Get Learner entity (many to one).
513
+     *
514
+     * @return Logipro\Bundle\SCORMBundle\Entity\Learner
515
+     */
516
+    public function getLearner()
517
+    {
518
+        return $this->learner;
519
+    }
520
+
493 521
     /**
494 522
      * Add Scorm2004Comment entity to collection (one to many).
495 523
      *

+ 7
- 0
Resources/config/doctrine/Scorm2004.Scorm2004Track.orm.xml View File

@@ -70,6 +70,13 @@
70 70
         <join-column name="registration_attempt_fk" referenced-column-name="registration_attempt_id" nullable=""/>
71 71
       </join-columns>
72 72
     </many-to-one>
73
+
74
+    <!-- apprenant auquel le track est lié -->
75
+    <many-to-one field="learner" target-entity="Logipro\Bundle\SCORMBundle\Entity\Learner" inversed-by="scorm2004Tracks" fetch="LAZY">
76
+      <join-columns>
77
+        <join-column name="learner_fk" referenced-column-name="learner_id" nullable=""/>
78
+      </join-columns>
79
+    </many-to-one>
73 80
   
74 81
   </entity>
75 82
 </doctrine-mapping>

Loading…
Cancel
Save