Skip to content

Instantly share code, notes, and snippets.

Avatar

Enrico Stano enricostano

  • Barcelona, Spain
View GitHub Profile
View Term.php
<?php
namespace StanoSas\Bundle\TaxonomyBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* StanoSas\Bundle\TaxonomyBundle\Entity\Term
View TermController.php
<?php
namespace StanoSas\Bundle\TaxonomyBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use StanoSas\Bundle\TaxonomyBundle\Entity\Term;
use StanoSas\Bundle\TaxonomyBundle\Form\TermType;
class TermController extends Controller
{
View gist:2882328
Queries
SET NAMES UTF8
Parameters: { }
Time: 0.67 ms
SELECT t0.username AS username1, t0.username_canonical AS username_canonical2, t0.email AS email3, t0.email_canonical AS email_canonical4, t0.enabled AS enabled5, t0.salt AS salt6, t0.password AS password7, t0.last_login AS last_login8, t0.locked AS locked9, t0.expired AS expired10, t0.expires_at AS expires_at11, t0.confirmation_token AS confirmation_token12, t0.password_requested_at AS password_requested_at13, t0.roles AS roles14, t0.credentials_expired AS credentials_expired15, t0.credentials_expire_at AS credentials_expire_at16, t0.id AS id17 FROM fos_user t0 WHERE t0.username_canonical = ?
Parameters: [enricostn]
Time: 3.09 ms
View gist:2882371
<?php
namespace StanoSas\Bundle\TaxonomyBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
/**
* StanoSas\Bundle\TaxonomyBundle\Entity\Vocabulary
*
View gist:2882378
<?php
namespace StanoSas\Bundle\TaxonomyBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Doctrine\Common\Collections\ArrayCollection;
use Gedmo\Mapping\Annotation as Gedmo;
/**
* StanoSas\Bundle\TaxonomyBundle\Entity\Term
View form.html.twig
{{ ownerObj.name }}
<form action="{{ path('StanoSasDocumentBundle_attachment_create', { 'ownerObj': ownerObj }) }}" method="post" {{ form_enctype(form) }} class="">
{{ form_widget(form) }}
<p>
<input type="submit" value="Submit">
</p>
</form>
View Attachment.php
<?php
namespace StanoSas\Bundle\DocumentBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\HttpFoundation\File\File;
use Symfony\Component\HttpFoundation\File\UploadedFile;
View Gara.php
<?php
namespace StanoSas\Bundle\DocumentBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Symfony\Component\Validator\Constraints as Assert;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\Common\Collections\ArrayCollection;
use StanoSas\Bundle\UserBundle\Entity\User;
@enricostano
enricostano / GaraController.php
Created Jun 9, 2012
Show Action in GaraController
View GaraController.php
public function showAction($gid)
{
$em = $this->getDoctrine()->getEntityManager();
$gara = $em->getRepository('StanoSasDocumentBundle:Gara')
->find($gid);
if (!$gara){
throw $this->createNotFoundException('Unable to find Gara.');
}
View AttachmentController.php
<?php
namespace StanoSas\Bundle\DocumentBundle\Controller;
use Symfony\Bundle\FrameworkBundle\Controller\Controller;
use StanoSas\Bundle\DocumentBundle\Entity\Attachment;
use StanoSas\Bundle\DocumentBundle\Form\AttachmentType;
class AttachmentController extends Controller
{