Skip to content
GitLab
Projects
Groups
Snippets
/
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
mathieu
potage
Commits
092adf2c
Commit
092adf2c
authored
Jun 16, 2018
by
Mat
Browse files
Ajout des entités Groupe et Depot, génère les getters, déclare attributs et relations
parent
0ed10472
Changes
5
Hide whitespace changes
Inline
Side-by-side
src/PotageBundle/Entity/Depot.php
0 → 100644
View file @
092adf2c
<?php
namespace
PotageBundle\Entity
;
use
Doctrine\ORM\Mapping
as
ORM
;
/**
* Depot
*
* @ORM\Table(name="depot")
* @ORM\Entity(repositoryClass="PotageBundle\Repository\DepotRepository")
* @ORM\HasLifecycleCallbacks()
*/
class
Depot
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private
$id
;
/**
* @var
* @ORM\OneToOne(targetEntity="PotageBundle\Entity\Groupe", mappedBy="depot")
*/
private
$groupe
;
/**
* @var string
* @ORM\Column(name="localisation", type="string", length=100)
*/
private
$localisation
;
// /**
// * @var integer
// * @ORM\OneToOne(targetEntity="PotageBundle\Entity\Utilisateur", inversedBy="depot")
// * @ORM\JoinColumn(name="id_responsable", referencedColumnName="id")
// */
// private $responsable;
/**
* @var integer
* @ORM\Column(name="jour_panier", type="integer", length=1)
*/
private
$jourPanier
;
/**
* @var \DateTime
* @ORM\Column(name="heure_panier", type="DateTime")
*/
private
$heurePanier
;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime")
*/
private
$createdAt
;
/**
* @var \DateTime
*
* @ORM\Column(name="updated_at", type="datetime", nullable=true)
*/
private
$updatedAt
;
/**
*
* @ORM\PrePersist()
*/
public
function
prePersist
()
{
$this
->
createdAt
=
new
\
DateTime
();
}
/**
*
* @ORM\PreUpdate()
*/
public
function
preUpdate
()
{
$this
->
updatedAt
=
new
\
DateTime
();
}
/**
* Get id
*
* @return int
*/
public
function
getId
()
{
return
$this
->
id
;
}
/**
* Set localisation
*
* @param string $localisation
*
* @return Depot
*/
public
function
setLocalisation
(
$localisation
)
{
$this
->
localisation
=
$localisation
;
return
$this
;
}
/**
* Get localisation
*
* @return string
*/
public
function
getLocalisation
()
{
return
$this
->
localisation
;
}
/**
* Set jourPanier
*
* @param integer $jourPanier
*
* @return Depot
*/
public
function
setJourPanier
(
$jourPanier
)
{
$this
->
jourPanier
=
$jourPanier
;
return
$this
;
}
/**
* Get jourPanier
*
* @return integer
*/
public
function
getJourPanier
()
{
return
$this
->
jourPanier
;
}
/**
* Set heurePanier
*
* @param \DateTime $heurePanier
*
* @return Depot
*/
public
function
setHeurePanier
(
\
DateTime
$heurePanier
)
{
$this
->
heurePanier
=
$heurePanier
;
return
$this
;
}
/**
* Get heurePanier
*
* @return \DateTime
*/
public
function
getHeurePanier
()
{
return
$this
->
heurePanier
;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
*
* @return Depot
*/
public
function
setCreatedAt
(
$createdAt
)
{
$this
->
createdAt
=
$createdAt
;
return
$this
;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public
function
getCreatedAt
()
{
return
$this
->
createdAt
;
}
/**
* Set updatedAt
*
* @param \DateTime $updatedAt
*
* @return Depot
*/
public
function
setUpdatedAt
(
$updatedAt
)
{
$this
->
updatedAt
=
$updatedAt
;
return
$this
;
}
/**
* Get updatedAt
*
* @return \DateTime
*/
public
function
getUpdatedAt
()
{
return
$this
->
updatedAt
;
}
/**
* Set groupe
*
* @param \PotageBundle\Entity\Groupe $groupe
*
* @return Depot
*/
public
function
setGroupe
(
\
PotageBundle\Entity\Groupe
$groupe
=
null
)
{
$this
->
groupe
=
$groupe
;
return
$this
;
}
/**
* Get groupe
*
* @return \PotageBundle\Entity\Groupe
*/
public
function
getGroupe
()
{
return
$this
->
groupe
;
}
}
src/PotageBundle/Entity/Groupe.php
0 → 100644
View file @
092adf2c
<?php
namespace
PotageBundle\Entity
;
use
Doctrine\ORM\Mapping
as
ORM
;
/**
* Groupe
*
* @ORM\Table(name="groupe")
* @ORM\Entity(repositoryClass="PotageBundle\Repository\GroupeRepository")
* @ORM\HasLifecycleCallbacks()
*/
class
Groupe
{
/**
* @var int
*
* @ORM\Column(name="id", type="integer")
* @ORM\Id
* @ORM\GeneratedValue(strategy="AUTO")
*/
private
$id
;
/**
* @var Lettre[]
* @ORM\OneToMany(targetEntity="PotageBundle\Entity\Lettre", mappedBy="groupe")
*/
private
$lettres
;
/**
* @var
* @ORM\OneToOne(targetEntity="PotageBundle\Entity\Depot", inversedBy="groupe")
* @ORM\JoinColumn(name="id_depot", referencedColumnName="id")
*/
private
$depot
;
/**
* @var string
*
* @ORM\Column(name="nom", type="string", length=100)
*/
private
$nom
;
/**
* @ORM\Column(length=128, unique=true)
*/
private
$slug
;
/**
* @var string
*
* @ORM\Column(name="description", type="text")
*/
private
$description
;
/**
* @var \DateTime
*
* @ORM\Column(name="created_at", type="datetime")
*/
private
$createdAt
;
/**
* @var \DateTime
*
* @ORM\Column(name="updated_at", type="datetime", nullable=true)
*/
private
$updatedAt
;
/**
*
* @ORM\PrePersist()
*/
public
function
prePersist
()
{
$this
->
createdAt
=
new
\
DateTime
();
}
/**
*
* @ORM\PreUpdate()
*/
public
function
preUpdate
()
{
$this
->
updatedAt
=
new
\
DateTime
();
}
/**
* Get id
*
* @return int
*/
public
function
getId
()
{
return
$this
->
id
;
}
/**
* Constructor
*/
public
function
__construct
()
{
$this
->
lettres
=
new
\
Doctrine\Common\Collections\ArrayCollection
();
}
/**
* Set nom
*
* @param string $nom
*
* @return Groupe
*/
public
function
setNom
(
$nom
)
{
$this
->
nom
=
$nom
;
return
$this
;
}
/**
* Get nom
*
* @return string
*/
public
function
getNom
()
{
return
$this
->
nom
;
}
/**
* Set slug
*
* @param string $slug
*
* @return Groupe
*/
public
function
setSlug
(
$slug
)
{
$this
->
slug
=
$slug
;
return
$this
;
}
/**
* Get slug
*
* @return string
*/
public
function
getSlug
()
{
return
$this
->
slug
;
}
/**
* Set description
*
* @param string $description
*
* @return Groupe
*/
public
function
setDescription
(
$description
)
{
$this
->
description
=
$description
;
return
$this
;
}
/**
* Get description
*
* @return string
*/
public
function
getDescription
()
{
return
$this
->
description
;
}
/**
* Set createdAt
*
* @param \DateTime $createdAt
*
* @return Groupe
*/
public
function
setCreatedAt
(
$createdAt
)
{
$this
->
createdAt
=
$createdAt
;
return
$this
;
}
/**
* Get createdAt
*
* @return \DateTime
*/
public
function
getCreatedAt
()
{
return
$this
->
createdAt
;
}
/**
* Set updatedAt
*
* @param \DateTime $updatedAt
*
* @return Groupe
*/
public
function
setUpdatedAt
(
$updatedAt
)
{
$this
->
updatedAt
=
$updatedAt
;
return
$this
;
}
/**
* Get updatedAt
*
* @return \DateTime
*/
public
function
getUpdatedAt
()
{
return
$this
->
updatedAt
;
}
/**
* Add lettre
*
* @param \PotageBundle\Entity\Lettre $lettre
*
* @return Groupe
*/
public
function
addLettre
(
\
PotageBundle\Entity\Lettre
$lettre
)
{
$this
->
lettres
[]
=
$lettre
;
return
$this
;
}
/**
* Remove lettre
*
* @param \PotageBundle\Entity\Lettre $lettre
*/
public
function
removeLettre
(
\
PotageBundle\Entity\Lettre
$lettre
)
{
$this
->
lettres
->
removeElement
(
$lettre
);
}
/**
* Get lettres
*
* @return \Doctrine\Common\Collections\Collection
*/
public
function
getLettres
()
{
return
$this
->
lettres
;
}
/**
* Set depot
*
* @param \PotageBundle\Entity\Depot $depot
*
* @return Groupe
*/
public
function
setDepot
(
\
PotageBundle\Entity\Depot
$depot
=
null
)
{
$this
->
depot
=
$depot
;
return
$this
;
}
/**
* Get depot
*
* @return \PotageBundle\Entity\Depot
*/
public
function
getDepot
()
{
return
$this
->
depot
;
}
}
src/PotageBundle/Entity/Lettre.php
View file @
092adf2c
...
...
@@ -42,7 +42,8 @@ class Lettre
/**
* @var int
* @ORM\Column(name="id_groupe", type="integer", nullable=false)
* @ORM\ManyToOne(targetEntity="PotageBundle\Entity\Groupe", inversedBy="lettres")
* @ORM\JoinColumn(name="id_groupe", nullable=false)
*/
private
$groupe
;
...
...
src/PotageBundle/Repository/DepotRepository.php
0 → 100755
View file @
092adf2c
<?php
namespace
PotageBundle\Repository
;
/**
* DepotRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class
DepotRepository
extends
\
Doctrine\ORM\EntityRepository
{
}
src/PotageBundle/Repository/GroupeRepository.php
0 → 100755
View file @
092adf2c
<?php
namespace
PotageBundle\Repository
;
/**
* GroupeRepository
*
* This class was generated by the Doctrine ORM. Add your own custom
* repository methods below.
*/
class
GroupeRepository
extends
\
Doctrine\ORM\EntityRepository
{
}
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment