Skip to content

Instantly share code, notes, and snippets.

View taiebb's full-sized avatar

Taieb BACCOUCHE taiebb

  • Check24
  • Munich
View GitHub Profile
public function deleteFromDatatableAction($id) {
$em = $this->getDoctrine()->getManager();
$entity = $em->getRepository('NomDuBundle:NomEntite')->find($id);
if (!$entity) {
throw $this->createNotFoundException('Unable to find Entity.');
}
$em->remove($entity);
$em->flush();
@taiebb
taiebb / document.php
Last active December 30, 2015 21:00
upload file
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
public $path;
public function getAbsolutePath()
{
return null === $this->path
? null
: $this->getUploadRootDir().'/'.$this->path;
@taiebb
taiebb / Address.php
Last active March 10, 2016 09:39
The required option "em" is missing.
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
/**
* Address
*
* @ORM\Table(name="address")
<?php
class CompetenceTransformer implements DataTransformerInterface {
/**
* @var ObjectManager
*/
private $om;
/**
@taiebb
taiebb / ProfileAdminController.php
Last active March 22, 2016 11:34
Object(Symfony\Component\Form\Form).data.plainPassword = null
<?php
namespace UserBundle\Controller\Admin;
use Symfony\Component\DependencyInjection\ContainerAware;
use Symfony\Component\HttpFoundation\RedirectResponse;
use Symfony\Component\Security\Core\Exception\AccessDeniedException;
use FOS\UserBundle\Model\UserInterface;
use FOS\UserBundle\Controller\ProfileController as BaseController;
use Sensio\Bundle\FrameworkExtraBundle\Configuration\Method;
@taiebb
taiebb / CandidatesLanguages.php
Last active March 30, 2016 15:15
SQLSTATE[23000]: Integrity constraint violation: 1062 Duplicate entry '1-1' for key 'languagesCandidates'
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
use Symfony\Component\Validator\Constraints as Assert;
/**
* CandidatesLanguages
<?php
namespace AppBundle\Controller\Api;
header('Access-Control-Allow-Origin: *');
use FOS\RestBundle\Controller\FOSRestController;
use FOS\RestBundle\Controller\Annotations as Rest;
use Nelmio\ApiDocBundle\Annotation\ApiDoc;
/**
<?php
class SSII
{
public function doDevelopment()
{
$apiManager = $this->get('ssi_api_manager');
return $apiManager->develop();
}
}
{
"company_registration":{
"email":"baccouch7.taieb@gmail.com",
"username":"jjjjjj",
"plainPassword":{
"first":"xxxxx",
"second":"xxxxx"
},
"companyUser": {
"firstName": "Taieb",
var FormValidation = function () {
// basic validation
var handleValidation1 = function () {
// for more info visit the official plugin documentation:
// http://docs.jquery.com/Plugins/Validation
var form1 = $('#frm_createAccount');
form1.validate({
errorElement: 'span', //default input error message container