Exemplo n.º 1
0
 /**
  * Copy given sco and its children.
  *
  * @param Scorm2004Sco      $sco
  * @param Scorm2004Resource $resource
  * @param Scorm2004Sco      $scoParent
  */
 private function copySco(Scorm2004Sco $sco, Scorm2004Resource $resource, Scorm2004Sco $scoParent = null)
 {
     $scoCopy = new Scorm2004Sco();
     $scoCopy->setScormResource($resource);
     $scoCopy->setScoParent($scoParent);
     $scoCopy->setEntryUrl($sco->getEntryUrl());
     $scoCopy->setIdentifier($sco->getIdentifier());
     $scoCopy->setIsBlock($sco->getIsBlock());
     $scoCopy->setLaunchData($sco->getLaunchData());
     $scoCopy->setParameters($sco->getParameters());
     $scoCopy->setTimeLimitAction($sco->getTimeLimitAction());
     $scoCopy->setTitle($sco->getTitle());
     $scoCopy->setVisible($sco->isVisible());
     $this->om->persist($scoCopy);
     foreach ($sco->getScoChildren() as $scoChild) {
         $this->copySco($scoChild, $resource, $scoCopy);
     }
 }