private function getLogin($contentEncoded, $user, $categoryId)
 {
     $login = new Login();
     $content = $login->decode($contentEncoded->getContent(), $this->container, $user->getPassword());
     $content['categoryId'] = $categoryId;
     $content['name'] = $contentEncoded->getName();
     return $content;
 }
 public function getListAction()
 {
     $contents = $this->getDoctrine()->getRepository('UniquePasswordBundle:Content')->findAll();
     $listOfContents = array();
     foreach ($contents as $content) {
         $loginContent = new Login();
         $listOfContents[] = ['id' => $content->getId(), 'name' => $content->getName(), 'category' => $content->getCategory()->getName(), 'created' => $content->getCreated()->format('d/m/Y H:i:s'), 'modified' => $content->getModified()->format('d/m/Y H:i:s'), 'content' => $loginContent->decode($content->getContent(), $this->container, $this->getUser()->getPassword())];
     }
     $response = new Response();
     $response->setContent(json_encode($listOfContents));
     $response->setStatusCode(Response::HTTP_OK);
     return $response;
 }
 /**
  * This method is responsible for updating a new Login Class Category
  *
  * @param stdObject $entryContent contains the content that has been passed
  * by the form
  * @param Symfony\Bundle\FrameworkBundle\Controller $user
  */
 private function updateLogin($id, $entryContent, $user)
 {
     $loginContent = new Login();
     $loginContent->setBase($entryContent->siteUsername, $entryContent->sitePasword, $entryContent->siteSitename);
     $this->updateContent($id, $entryContent, $loginContent, $user);
 }