Skip to content

Instantly share code, notes, and snippets.

@elodie-nazaret
Last active December 7, 2015 10:45
Show Gist options
  • Save elodie-nazaret/acc9765039385ec8f9aa to your computer and use it in GitHub Desktop.
Save elodie-nazaret/acc9765039385ec8f9aa to your computer and use it in GitHub Desktop.
Project entity
<?php
namespace AppBundle\Entity;
use Doctrine\ORM\Mapping as ORM;
use Knp\DoctrineBehaviors\Model as ORMBehaviors;
use Doctrine\Common\Collections\ArrayCollection;
use Symfony\Component\Validator\Constraints as Assert;
use Algolia\AlgoliaSearchBundle\Mapping\Annotation as Algolia;
/**
* Class Project
*
* @ORM\Entity(repositoryClass="AppBundle\Entity\ProjectRepository")
* @ORM\Table(name="project")
* @Algolia\Index()
*/
class Project
{
use ORMBehaviors\Timestampable\Timestampable;
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
*/
private $id;
/**
* @var string
*
* @ORM\Column(type="string", name="realisation_name"))
* @Algolia\Attribute()
*/
private $realisationName;
/**
* @var int
*
* @ORM\Column(type="integer", name="realisation_year"))
* @Algolia\Attribute()
*/
private $realisationYear;
/**
* @var string
*
* @ORM\Column(type="string", name="num_hormann"))
*/
private $numHormann;
/**
* @var string
*
* @ORM\Column(type="string", name="distributor", nullable=true))
* @Algolia\Attribute()
*/
private $distributor;
/**
* @var string
*
* @ORM\Column(type="string", name="client_name"))
* @Algolia\Attribute()
*/
private $clientName;
/**
* @var string
*
* @ORM\Column(type="string", name="application_precision", nullable=true))
* @Algolia\Attribute()
*/
private $applicationPrecision;
/**
* @var string
*
* @ORM\Column(type="text", name="comment", nullable=true))
* @Algolia\Attribute()
*/
private $comment;
/**
* @var bool
*
* @ORM\Column(type="boolean", name="approved"))
* @Algolia\Attribute()
*/
private $approved = false;
/**
* @var \DateTime
*
* @ORM\Column(type="datetime", name="approved_at", nullable=true))
*/
private $approvedAt;
/**
* @var string
*
* @ORM\Column(type="string", name="address"))
* @Algolia\Attribute()
*/
private $address;
/**
* @var float
*
* @ORM\Column(type="float", name="latitude"))
* @Algolia\Attribute()
*/
private $latitude;
/**
* @var float
*
* @ORM\Column(type="float", name="longitude"))
* @Algolia\Attribute()
*/
private $longitude;
/**
* @var string
*
* @ORM\Column(type="string", name="county"))
* @Algolia\Attribute()
*/
private $county;
/**
* @var string
*
* @ORM\Column(type="string", name="region"))
* @Algolia\Attribute()
*/
private $region;
/**
* @var string
*
* @ORM\Column(type="string", name="zip_code"))
* @Algolia\Attribute()
*/
private $zipCode;
/**
* @var string
*
* @ORM\Column(type="string", name="city"))
* @Algolia\Attribute()
*/
private $city;
/**
* @var string
*
* @ORM\Column(type="string", name="plain_address"))
* @Algolia\Attribute()
*/
private $plainAddress;
/**
* @var RegionalManagement
*
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\RegionalManagement")
* @ORM\JoinColumn(name="regional_management_id", referencedColumnName="id")
* @Algolia\Attribute()
*/
private $regionalManagement;
/**
* @var FinalUser
*
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\FinalUser")
* @ORM\JoinColumn(name="final_user_id", referencedColumnName="id")
*/
private $finalUser;
/**
* @var BusinessSector
*
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\BusinessSector")
* @ORM\JoinColumn(name="business_sector_id", referencedColumnName="id", nullable=true)
*/
private $businessSector;
/**
* @var Application
*
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\Application")
* @ORM\JoinColumn(name="application_id", referencedColumnName="id")
*/
private $application;
/**
* @var User
*
* @ORM\ManyToOne(targetEntity="AppBundle\Entity\User", inversedBy="projects")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
private $user;
/**
* @var Favorite[]
*
* @ORM\OneToMany(targetEntity="Favorite", mappedBy="project")
**/
private $favorites;
/**
* @var Picture[]
*
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Picture", mappedBy="project", cascade={"persist", "remove"})
*/
private $pictures;
/**
* @var Product[]
*
* @ORM\OneToMany(targetEntity="AppBundle\Entity\Product", mappedBy="project", cascade={"persist", "remove"})
*/
private $products;
/**
* Project constructor.
*/
public function __construct()
{
$this->pictures = new ArrayCollection();
$this->favorites = new ArrayCollection();
$this->products = new ArrayCollection();
}
/**
* @return int
*/
public function getId()
{
return $this->id;
}
/**
* @return string
*/
public function getRealisationName()
{
return $this->realisationName;
}
/**
* @param string $realisationName
*/
public function setRealisationName($realisationName)
{
$this->realisationName = $realisationName;
}
/**
* @return int
*/
public function getRealisationYear()
{
return $this->realisationYear;
}
/**
* @param int $realisationYear
*/
public function setRealisationYear($realisationYear)
{
$this->realisationYear = $realisationYear;
}
/**
* @return string
*/
public function getNumHormann()
{
return $this->numHormann;
}
/**
* @param string $numHormann
*/
public function setNumHormann($numHormann)
{
$this->numHormann = $numHormann;
}
/**
* @return string
*/
public function getDistributor()
{
return $this->distributor;
}
/**
* @param string $distributor
*/
public function setDistributor($distributor)
{
$this->distributor = $distributor;
}
/**
* @return string
*/
public function getClientName()
{
return $this->clientName;
}
/**
* @param string $clientName
*/
public function setClientName($clientName)
{
$this->clientName = $clientName;
}
/**
* @return string
*/
public function getApplicationPrecision()
{
return $this->applicationPrecision;
}
/**
* @param string $applicationPrecision
*/
public function setApplicationPrecision($applicationPrecision)
{
$this->applicationPrecision = $applicationPrecision;
}
/**
* @return string
*/
public function getComment()
{
return $this->comment;
}
/**
* @param string $comment
*/
public function setComment($comment)
{
$this->comment = $comment;
}
/**
* @return boolean
*/
public function isApproved()
{
return $this->approved;
}
/**
* @param boolean $approved
*/
public function setApproved($approved)
{
$this->approved = $approved;
}
/**
* @return \DateTime
*/
public function getApprovedAt()
{
return $this->approvedAt;
}
/**
* @param \DateTime $approvedAt
*/
public function setApprovedAt($approvedAt)
{
$this->approvedAt = $approvedAt;
}
/**
* @return string
*/
public function getAddress()
{
return $this->address;
}
/**
* @param string $address
*/
public function setAddress($address)
{
$this->address = $address;
}
/**
* @return float
*/
public function getLatitude()
{
return $this->latitude;
}
/**
* @param float $latitude
*/
public function setLatitude($latitude)
{
$this->latitude = $latitude;
}
/**
* @return float
*/
public function getLongitude()
{
return $this->longitude;
}
/**
* @param float $longitude
*/
public function setLongitude($longitude)
{
$this->longitude = $longitude;
}
/**
* @return RegionalManagement
*/
public function getRegionalManagement()
{
return $this->regionalManagement;
}
/**
* @param RegionalManagement $regionalManagement
*/
public function setRegionalManagement($regionalManagement)
{
$this->regionalManagement = $regionalManagement;
}
/**
* @return FinalUser
*/
public function getFinalUser()
{
return $this->finalUser;
}
/**
* @param FinalUser $finalUser
*/
public function setFinalUser($finalUser)
{
$this->finalUser = $finalUser;
}
/**
* @return BusinessSector
*/
public function getBusinessSector()
{
return $this->businessSector;
}
/**
* @param BusinessSector $businessSector
*/
public function setBusinessSector($businessSector)
{
$this->businessSector = $businessSector;
}
/**
* @return Application
*/
public function getApplication()
{
return $this->application;
}
/**
* @param Application $application
*/
public function setApplication($application)
{
$this->application = $application;
}
/**
* @return User
*/
public function getUser()
{
return $this->user;
}
/**
* @param User $user
*/
public function setUser($user)
{
$this->user = $user;
}
/**
* @return Picture[]
*/
public function getPictures()
{
return $this->pictures;
}
/**
* @param Picture[] $pictures
*/
public function setPictures($pictures)
{
$this->pictures = $pictures;
}
/**
* @param Picture $picture
*/
public function addPicture(Picture $picture)
{
$picture->setProject($this);
$this->pictures->add($picture);
}
/**
* @param Picture $picture
*/
public function removePicture(Picture $picture)
{
$this->pictures->removeElement($picture);
}
/**
* @return Favorite[]
*/
public function getFavorites()
{
return $this->favorites;
}
/**
* @param Favorite[] $favorites
*/
public function setFavorites($favorites)
{
$this->favorites = $favorites;
}
/**
* @param Favorite $favorite
*/
public function addFavorite(Favorite $favorite)
{
$this->favorites->add($favorite);
}
/**
* @param Favorite $favorite
*/
public function removeFavorite(Favorite $favorite)
{
$this->favorites->removeElement($favorite);
}
/**
* @return string
*/
public function getCounty()
{
return $this->county;
}
/**
* @param string $county
*/
public function setCounty($county)
{
$this->county = $county;
}
/**
* @return string
*/
public function getRegion()
{
return $this->region;
}
/**
* @param string $region
*/
public function setRegion($region)
{
$this->region = $region;
}
/**
* @return string
*/
public function getZipCode()
{
return $this->zipCode;
}
/**
* @param string $zipCode
*/
public function setZipCode($zipCode)
{
$this->zipCode = $zipCode;
}
/**
* @return string
*/
public function getCity()
{
return $this->city;
}
/**
* @param string $city
*/
public function setCity($city)
{
$this->city = $city;
}
/**
* @return string
*/
public function getPlainAddress()
{
return $this->plainAddress;
}
/**
* @param string $plainAddress
*/
public function setPlainAddress($plainAddress)
{
$this->plainAddress = $plainAddress;
}
/**
* @return Product[]
*/
public function getProducts()
{
return $this->products;
}
/**
* @param Product[] $products
*/
public function setProducts($products)
{
$this->products = $products;
}
/**
* @param Product $product
*/
public function addProduct(Product $product)
{
$product->setProject($this);
$this->products->add($product);
}
/**
* @param Product $product
*/
public function removeProduct(Product $product)
{
$this->products->removeElement($product);
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment