1. Go to this page and download the library: Download lyssal/collection-bundle library. Choose the download type require.
2. Extract the ZIP file and open the index.php.
3. Add this code to the index.php.
<?php
require_once('vendor/autoload.php');
/* Start to develop here. Best regards https://php-download.com/ */
lyssal / collection-bundle example snippets
namespace Acme\CollectionBundle;
use Symfony\Component\HttpKernel\Bundle\Bundle;
class AcmeCollectionBundle extends Bundle
{
public function getParent()
{
return 'LyssalCollectionBundle';
}
}
namespace Acme\CollectionBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Lyssal\CollectionBundle\Entity\ElementDate as ElementDateBase;
/**
* Date d'un élément.
*
* @ORM\Entity()
* @ORM\Table(name="acme_element_a_date", uniqueConstraints={@ORM\UniqueConstraint(name="ELEMENT_PAYS", columns={"element_id", "pays_id"})})
*/
class ElementDate extends ElementDateBase
{
/**
* @var \Acme\CollectionBundle\Entity\Element
*
* @ORM\ManyToOne(targetEntity="Element", inversedBy="elementDates")
* @ORM\JoinColumn(name="element_id", referencedColumnName="element_id", nullable=false, onDelete="CASCADE")
*/
protected $element;
/**
* @var \Acme\GeographieBundle\Entity\Pays
*
* @ORM\ManyToOne(targetEntity="\Acme\GeographieBundle\Entity\Pays", inversedBy="elementDates")
* @ORM\JoinColumn(name="pays_id", referencedColumnName="pays_id", nullable=false, onDelete="CASCADE")
*/
protected $pays;
}
namespace Acme\CollectionBundle\Entity;
use Lyssal\CollectionBundle\Entity\ElementGroupe as ElementGroupeBase;
use Doctrine\ORM\Mapping as ORM;
/**
* Groupe d'éléments.
*
* @ORM\Entity()
* @ORM\Table(name="acme_element_groupe")
*/
class ElementGroupe extends ElementGroupeBase
{
}
namespace Acme\CollectionBundle\Entity;
use Lyssal\CollectionBundle\Entity\PersonneRole as PersonneRoleBase;
use Doctrine\ORM\Mapping as ORM;
/**
* PersonneRole.
*
* @ORM\Entity()
* @ORM\Table(name="acme_personne_role")
*/
class PersonneRole extends PersonneRoleBase
{
}
namespace Acme\CollectionBundle\Entity;
use Lyssal\CollectionBundle\Entity\Plateforme as PlateformeBase;
use Doctrine\ORM\Mapping as ORM;
/**
* Plateforme.
*
* @ORM\Entity()
* @ORM\Table(name="acme_plateforme")
*/
class Plateforme extends PlateformeBase
{
}
namespace Acme\CollectionBundle\Entity;
use Lyssal\CollectionBundle\Entity\SocieteRole as SocieteRoleBase;
use Doctrine\ORM\Mapping as ORM;
/**
* SocieteRole.
*
* @author Rémi Leclerc <[email protected]>
* @ORM\Entity()
* @ORM\Table(name="acme_societe_role")
*/
class SocieteRole extends SocieteRoleBase
{
}
namespace Acme\CollectionBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Lyssal\CollectionBundle\Entity\Support as SupportBase;
/**
* Support.
*
* @ORM\Entity()
* @ORM\Table(name="acme_support")
*/
class Support extends SupportBase
{
/**
* @var array<\Acme\CollectionBundle\Entity\ElementSupport>
*
* @ORM\OneToMany(targetEntity="ElementSupport", mappedBy="support")
*/
protected $elementSupports;
/**
* @var array<\Acme\CollectionBundle\Entity\UtilisateurSupport>
*
* @ORM\OneToMany(targetEntity="UtilisateurSupport", mappedBy="support")
*/
protected $utilisateurSupports;
}
namespace Acme\CollectionBundle\Entity;
use Lyssal\CollectionBundle\Entity\SupportLangageType as SupportLangageTypeBase;
use Doctrine\ORM\Mapping as ORM;
/**
* SupportLangageType.
*
* @ORM\Entity()
* @ORM\Table(name="acme_support_langage_type")
*/
class SupportLangageType extends SupportLangageTypeBase
{
}
namespace Acme\CollectionBundle\Entity;
use Lyssal\CollectionBundle\Entity\Univers as UniversBase;
use Doctrine\ORM\Mapping as ORM;
/**
* Univers.
*
* @ORM\Entity()
* @ORM\Table(name="acme_univers")
*/
class Univers extends UniversBase
{
}
namespace Acme\CollectionBundle\Entity;
use Lyssal\CollectionBundle\Entity\UtilisateurSupport as UtilisateurSupportBase;
use Doctrine\ORM\Mapping as ORM;
/**
* Support personnalisé d'un utilisateur.
*
* @ORM\Entity()
* @ORM\Table(name="acme_utilisateur_a_support")
*/
class UtilisateurSupport extends UtilisateurSupportBase
{
/**
* // Ceci est un exemple, utilisez l'utilisateur souhaité (LyssalUtilisateur, FOSUser, etc)
* @var \Acme\UtilisateurBundle\Entity\Utilisateur
*
* @ORM\ManyToOne(targetEntity="\Acme\UtilisateurBundle\Entity\Utilisateur", inversedBy="utilisateurSupports")
* @ORM\JoinColumn(name="utilisateur_id", referencedColumnName="id", nullable=false, onDelete="CASCADE")
*/
protected $utilisateur;
/**
* @var \Acme\CollectionBundle\Entity\Support
*
* @ORM\ManyToOne(targetEntity="Support", inversedBy="utilisateurSupports")
* @ORM\JoinColumn(name="support_id", referencedColumnName="support_id", nullable=false, onDelete="CASCADE")
*/
protected $support;
/**
* @var array<\Acme\CollectionBundle\Entity\ElementSupport>
*
* @ORM\OneToMany(targetEntity="ElementSupport", mappedBy="utilisateurSupport")
*/
protected $elementSupports;
}
namespace Acme\CollectionBundle\Entity;
use Lyssal\CollectionBundle\Entity\Type as TypeBase;
use Doctrine\ORM\Mapping as ORM;
/**
* Type.
*
* @author Rémi Leclerc <[email protected]>
* @ORM\Entity()
* @ORM\Table(name="acme_type")
*/
class Type extends TypeBase
{
}
class Pays extends BasePays
{
/**
* @var array<\Acme\CollectionBundle\Entity\Element>
*
* @ORM\ManyToMany(targetEntity="\Acme\CollectionBundle\Entity\Element", mappedBy="origines")
*/
private $elements;
/**
* @var array<\Acme\CollectionBundle\Entity\ElementDate>
*
* @ORM\OneToMany(targetEntity="\Acme\CollectionBundle\Entity\ElementDate", mappedBy="pays")
*/
private $elementDates;
/**
* @var array<\Acme\CollectionBundle\Entity\ElementPrix>
*
* @ORM\OneToMany(targetEntity="\Acme\CollectionBundle\Entity\ElementPrix", mappedBy="pays")
*/
private $elementPrix;
/**
* @var array<\Acme\CollectionBundle\Entity\Societe>
*
* @ORM\OneToMany(targetEntity="\Acme\CollectionBundle\Entity\Societe", mappedBy="pays")
*/
private $societes;
/**
* @var array<\Acme\CollectionBundle\Entity\Personne>
*
* @ORM\OneToMany(targetEntity="\Acme\CollectionBundle\Entity\Personne", mappedBy="nationalite")
*/
private $personnes;
/**
* Constructor
*/
public function __construct()
{
parent::__construct();
$this->elements = new \Doctrine\Common\Collections\ArrayCollection();
$this->elementDates = new \Doctrine\Common\Collections\ArrayCollection();
$this->elementPrix = new \Doctrine\Common\Collections\ArrayCollection();
$this->societes = new \Doctrine\Common\Collections\ArrayCollection();
$this->personnes = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Add elements
*
* @param \Acme\CollectionBundle\Entity\Element $elements
* @return Pays
*/
public function addElement(\Acme\CollectionBundle\Entity\Element $elements)
{
$this->elements[] = $elements;
return $this;
}
/**
* Remove elements
*
* @param \Acme\CollectionBundle\Entity\Element $elements
*/
public function removeElement(\Acme\CollectionBundle\Entity\Element $elements)
{
$this->elements->removeElement($elements);
}
/**
* Get elements
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getElements()
{
return $this->elements;
}
/**
* Add elementDates
*
* @param \Acme\CollectionBundle\Entity\ElementDate $elementDates
* @return Pays
*/
public function addElementDate(\Acme\CollectionBundle\Entity\ElementDate $elementDates)
{
$this->elementDates[] = $elementDates;
return $this;
}
/**
* Remove elementDates
*
* @param \Acme\CollectionBundle\Entity\ElementDate $elementDates
*/
public function removeElementDate(\Acme\CollectionBundle\Entity\ElementDate $elementDates)
{
$this->elementDates->removeElement($elementDates);
}
/**
* Get elementDates
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getElementDates()
{
return $this->elementDates;
}
/**
* Add elementPrix
*
* @param \Acme\CollectionBundle\Entity\ElementPrix $elementPrix
* @return Pays
*/
public function addElementPrix(\Acme\CollectionBundle\Entity\ElementPrix $elementPrix)
{
$this->elementPrix[] = $elementPrix;
return $this;
}
/**
* Remove elementPrix
*
* @param \Acme\CollectionBundle\Entity\ElementPrix $elementPrix
*/
public function removeElementPrix(\Acme\CollectionBundle\Entity\ElementPrix $elementPrix)
{
$this->elementPrix->removeElement($elementPrix);
}
/**
* Get elementPrix
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getElementPrix()
{
return $this->elementPrix;
}
/**
* Add societes
*
* @param \Acme\CollectionBundle\Entity\Societe $societes
* @return Pays
*/
public function addSociete(\Acme\CollectionBundle\Entity\Societe $societes)
{
$this->societes[] = $societes;
return $this;
}
/**
* Remove societes
*
* @param \Acme\CollectionBundle\Entity\Societe $societes
*/
public function removeSociete(\Acme\CollectionBundle\Entity\Societe $societes)
{
$this->societes->removeElement($societes);
}
/**
* Get societes
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getSocietes()
{
return $this->societes;
}
/**
* Add personnes
*
* @param \Acme\CollectionBundle\Entity\Personne $personnes
* @return Pays
*/
public function addPersonne(\Acme\CollectionBundle\Entity\Personne $personnes)
{
$this->personnes[] = $personnes;
return $this;
}
/**
* Remove personnes
*
* @param \Acme\CollectionBundle\Entity\Personne $personnes
*/
public function removePersonne(\Acme\CollectionBundle\Entity\Personne $personnes)
{
$this->personnes->removeElement($personnes);
}
/**
* Get personnes
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getPersonnes()
{
return $this->personnes;
}
}
/**
* Langue.
*
* @ORM\Entity()
* @ORM\Table
* (
* name="acme_langue"
* )
*/
class Langue extends \Lyssal\GeographieBundle\Entity\Langue
{
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="Acme\UtilisateurBundle\Entity\Utilisateur", mappedBy="langue")
*/
protected $utilisateurs;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="Acme\CollectionBundle\Entity\ElementSupportLangue", mappedBy="langue")
*/
protected $elementSupportLangues;
/**
* @var \Doctrine\Common\Collections\Collection
*
* @ORM\OneToMany(targetEntity="Acme\CollectionBundle\Entity\Traduction\Element", mappedBy="langue")
*/
protected $traductionElements;
/**
* Constructeur.
*/
public function __construct()
{
$this->utilisateurs = new \Doctrine\Common\Collections\ArrayCollection();
$this->elementSupportLangues = new \Doctrine\Common\Collections\ArrayCollection();
$this->traductionElements = new \Doctrine\Common\Collections\ArrayCollection();
}
/**
* Add utilisateurs
*
* @param \Acme\UtilisateurBundle\Entity\Utilisateur $utilisateurs
* @return Langue
*/
public function addUtilisateur(\Acme\UtilisateurBundle\Entity\Utilisateur $utilisateurs)
{
$this->utilisateurs[] = $utilisateurs;
return $this;
}
/**
* Remove utilisateurs
*
* @param \Acme\UtilisateurBundle\Entity\Utilisateur $utilisateurs
*/
public function removeUtilisateur(\Acme\UtilisateurBundle\Entity\Utilisateur $utilisateurs)
{
$this->utilisateurs->removeElement($utilisateurs);
}
/**
* Get utilisateurs
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getUtilisateurs()
{
return $this->utilisateurs;
}
/**
* Remove elementSupportLangues
*
* @param \Lyssal\CollectionBundle\Entity\ElementSupportLangue $elementSupportLangues
*/
public function removeElementSupportLangue(\Lyssal\CollectionBundle\Entity\ElementSupportLangue $elementSupportLangues)
{
$this->elementSupportLangues->removeElement($elementSupportLangues);
}
/**
* Get elementSupportLangues
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getElementSupportLangues()
{
return $this->elementSupportLangues;
}
/**
* Add traductionElements
*
* @param \Acme\CollectionBundle\Entity\Traduction\Element $traductionElements
* @return Langue
*/
public function addTraductionElement(\Acme\CollectionBundle\Entity\Traduction\Element $traductionElements)
{
$this->traductionElements[] = $traductionElements;
return $this;
}
/**
* Remove traductionElements
*
* @param \Acme\CollectionBundle\Entity\Traduction\Element $traductionElements
*/
public function removeTraductionElement(\Acme\CollectionBundle\Entity\Traduction\Element $traductionElements)
{
$this->traductionElements->removeElement($traductionElements);
}
/**
* Get traductionElements
*
* @return \Doctrine\Common\Collections\Collection
*/
public function getTraductionElements()
{
return $this->traductionElements;
}
}