public function updatePublished($resourceId, $extraDataPublished)
 {
     $published = 0;
     if ($extraDataPublished == "on") {
         $published = 1;
     }
     $resourceNodes = $this->resourceNodeRepo->findBy(array('id' => $resourceId));
     foreach ($resourceNodes as $resourceNode) {
         $resourceNode->setPublished($published);
         $this->em->persist($resourceNode);
     }
     $this->em->flush();
     return $resourceNodes;
 }
Exemplo n.º 2
0
 /**
  * @param Workspace $workspace
  *
  * @return \Claroline\CoreBundle\Entity\Resource\ResourceNode[]
  */
 public function getByWorkspaceAndResourceType(Workspace $workspace, ResourceType $resourceType)
 {
     return $this->resourceNodeRepo->findBy(array('workspace' => $workspace, 'resourceType' => $resourceType), array('name' => 'ASC'));
 }