Skip to content

Instantly share code, notes, and snippets.

@Nightbr
Created October 2, 2018 08:45
Show Gist options
  • Save Nightbr/71c8eeae311270a3f2ee13734f310c49 to your computer and use it in GitHub Desktop.
Save Nightbr/71c8eeae311270a3f2ee13734f310c49 to your computer and use it in GitHub Desktop.
<?php
namespace App\Entity;
use ApiPlatform\Core\Annotation\ApiResource;
use ApiPlatform\Core\Annotation\ApiSubresource;
use Doctrine\ORM\Mapping as ORM;
use Gedmo\Mapping\Annotation as Gedmo;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\Serializer\Annotation\MaxDepth;
use Symfony\Component\Serializer\Annotation\Groups;
use Symfony\Bridge\Doctrine\Validator\Constraints\UniqueEntity;
/**
* @ApiResource()
* @ORM\Entity()
* @ORM\Table(name="company")
* @Gedmo\TranslationEntity(class="App\Entity\Translation\CompanyTranslation")
* @UniqueEntity("name")
*/
class Company
{
/**
* @var int
*
* @ORM\Id
* @ORM\Column(type="integer")
* @ORM\GeneratedValue(strategy="AUTO")
* @Groups({"out"})
*/
private $id;
/**
* @var string
*
* @Assert\NotBlank()
* @ORM\Column(type="string", unique=true)
* @Groups({"out", "in", "recruiter_in"})
*/
private $name;
/**
* @var string
*
* @Gedmo\Translatable
* @ORM\Column(type="text", nullable=true)
* @Groups({"out", "in", "recruiter_in"})
*/
private $description;
/**
* @var string
*
* @Gedmo\Translatable
* @ORM\Column(type="string", nullable=true)
* @Groups({"out", "in", "recruiter_in"})
*/
private $catchPhrase;
/**
* @var string
*
* @ORM\Column(type="string", nullable=false)
* @Gedmo\Slug(fields={"name"})
* @Groups({"out"})
*/
private $slug;
/**
* @var Locale
*
* @Gedmo\Locale
*/
private $locale;
public function __toString()
{
return $this->name;
}
............. SETTERS/GETTERS..................
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment