<?php
namespace App\Entity;
use App\Entity\Billing;
use Doctrine\ORM\Mapping as ORM;
use App\Utils\File\FileServiceTrait;
use Doctrine\Common\Collections\Collection;
use Doctrine\Common\Collections\ArrayCollection;
use Vich\UploaderBundle\Mapping\Annotation as Vich;
use Symfony\Component\Validator\Constraints as Assert;
use Symfony\Component\HttpFoundation\File\UploadedFile;
/**
* @ORM\Entity(repositoryClass="App\Repository\CompanyRepository")
* @Vich\Uploadable
*/
class Company implements \JsonSerializable
{
use FileServiceTrait;
public $targetDirectory;
const FILE_LOGO = "logo";
const FILE_COVER = "cover";
const FILE_PDF = "pdf";
const FILES = [
self::FILE_LOGO => [
'types' => ['gif', 'jpg', 'jpeg', 'png', 'tif', 'svg'],
'dir' => '/company_logo',
'size' => 5*1024*1024,
],
self::FILE_COVER => [
'types' => ['gif', 'jpg', 'jpeg', 'png', 'tif', 'svg'],
'dir' => '/company_cover',
'size' => 5*1024*1024,
],
self::FILE_PDF => [
'types' => ['pdf'],
'dir' => '/company_pdf',
'size' => 5*1024*1024,
]
];
const STATUS_ACTIVE = 1;
const STATUS_INACTIVE = 2;
const STATUSES = [
self::STATUS_ACTIVE => "Active",
self::STATUS_INACTIVE => "Inactive"
];
const COMPANY_FOLLOWERS_CHOOSE = 0;
const COMPANY_FOLLOWERS_MIN = 1;
const COMPANY_FOLLOWERS_MAX = 2;
const COMPANY_FOLLOWERS = [
self::COMPANY_FOLLOWERS_CHOOSE => "Choose",
self::COMPANY_FOLLOWERS_MIN => "Min",
self::COMPANY_FOLLOWERS_MAX => "Max",
];
/**
* @ORM\Id()
* @ORM\GeneratedValue()
* @ORM\Column(type="integer")
*/
private $id;
/**
* One Company has One User.
* @ORM\OneToOne(targetEntity="User", inversedBy="company")
* @ORM\JoinColumn(name="user_id", referencedColumnName="id")
*/
private $user;
/**
* @ORM\Column(type="string", length=128)
*/
private $companyName;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Industry")
*/
private $industry;
/**
* @ORM\ManyToOne(targetEntity="App\Entity\City")
* @ORM\JoinColumn(nullable=true)
*/
private $city;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $address;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $companySize;
/**
* @ORM\Column(type="integer", nullable=true)
*/
private $employeesAverageSize;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $website;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $email;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $facebook;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $twitter;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $linkedin;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $instagram;
/**
* @Assert\Length(max="14")
* @ORM\Column(type="string", length=14, nullable=true)
*/
private $phone;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $subdomain;
/**
* @ORM\Column(type="text")
*/
private $description;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $faq;
/**
* @ORM\Column(type="text", nullable=true)
*/
private $gdpr;
/**
* @ORM\Column(type="boolean", options={"default":"0"})
*/
private $featured = FALSE;
/**
* @ORM\Column(type="boolean", options={"default":"0"})
*/
private $addon = FALSE;
/**
* @ORM\Column(type="boolean", options={"default":"0"})
*/
private $newsOption = FALSE;
/**
* @ORM\OneToOne(targetEntity="App\Entity\Billing", mappedBy="company", cascade={"persist"}))
*/
private $billing;
/**
* @ORM\OneToMany(targetEntity="App\Entity\JobPosition", mappedBy="company")
*/
private $jobPositions;
/**
* @ORM\OneToMany(targetEntity="App\Entity\News", mappedBy="company")
*/
private $news;
/**
* @ORM\OneToMany(targetEntity="App\Entity\CompanySubscription", mappedBy="company")
*/
private $subscriptions;
/**
* @ORM\ManyToMany(targetEntity="App\Entity\Candidate", inversedBy="followedCompanies")
*/
private $followers;
/**
* @ORM\OneToMany(targetEntity="App\Entity\CompanyCompanyAdvantage", mappedBy="company")
*/
private $advantages;
/**
* @ORM\OneToMany(targetEntity="App\Entity\CompanyAboutUs", mappedBy="company")
*/
private $aboutUs;
/**
* @ORM\OneToMany(targetEntity="App\Entity\CompanyMosaic", mappedBy="company")
*/
private $mosaic;
/**
* @ORM\OneToMany(targetEntity="App\Entity\CompanyGallery", mappedBy="company")
*/
private $gallery;
/**
* @ORM\Column(type="integer", options={"default": "1"})
*/
private $status;
/**
* @ORM\Column(type="boolean", options={"default":"0"})
*/
private $mkariera = FALSE;
/**
* @ORM\Column(type="string", length=255, nullable=true)
*/
private $publication;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @var string|null
*/
private $coverThumbnail;
/**
* @Vich\UploadableField(mapping="thumbnails", fileNameProperty="coverThumbnail")
* @var File|null
*/
private $coverImageFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @var string|null
*/
private $logoThumbnail;
/**
* @Vich\UploadableField(mapping="thumbnails", fileNameProperty="logoThumbnail")
* @var File|null
*/
private $logoImageFile;
/**
* @ORM\Column(type="string", length=255, nullable=true)
* @var string|null
*/
private $pdfPreview;
/**
* @Vich\UploadableField(mapping="thumbnails", fileNameProperty="pdfPreview")
* @var File|null
*/
private $pdfFile;
/**
* @ORM\Column(type="datetime", nullable=true)
*/
private $imageUpdatedAt;
public function __construct()
{
$this->setStatus(self::STATUS_ACTIVE);
$this->industry = new ArrayCollection();
$this->jobPositions = new ArrayCollection();
$this->subscriptions = new ArrayCollection();
$this->followers = new ArrayCollection();
$this->advantages = new ArrayCollection();
$this->aboutUs = new ArrayCollection();
$this->mosaic = new ArrayCollection();
$this->gallery = new ArrayCollection();
$this->billing = new Billing();
}
public function getId(): ?int
{
return $this->id;
}
public function getUser(): ?User
{
return $this->user;
}
public function setUser(User $user): self
{
$this->user = $user;
return $this;
}
/**
* @param User $user
*
* @return Candidate
*/
public function removeUser(User $user): Company {
if ($this->user == $user) {
$this->user = null;
}
return $this;
}
public function getCompanyName(): ?string
{
return $this->companyName;
}
public function setCompanyName(string $companyName): self
{
$this->companyName = $companyName;
return $this;
}
/**
* @return Collection|Industry[]
*/
public function getIndustry(): Collection
{
return $this->industry;
}
public function addIndustry(Industry $industry): self
{
if (!$this->industry->contains($industry)) {
$this->industry[] = $industry;
}
return $this;
}
public function removeIndustry(Industry $industry): self
{
if ($this->industry->contains($industry)) {
$this->industry->removeElement($industry);
}
return $this;
}
public function removeIndustryAll(){
$this->industry->clear();
}
public function getCity(): ?City
{
return $this->city;
}
public function setCity(City $city): self
{
$this->city = $city;
return $this;
}
public function getAddress(): ?string
{
return $this->address;
}
public function setAddress(?string $address): self
{
$this->address = $address;
return $this;
}
public function getCompanySize(): ?string
{
return $this->companySize;
}
public function setCompanySize(?string $companySize): self
{
$this->companySize = $companySize;
return $this;
}
public function getEmployeesAverageSize(): ?string
{
return $this->employeesAverageSize;
}
public function setEmployeesAverageSize(?string $employeesAverageSize): self
{
$this->employeesAverageSize = $employeesAverageSize;
return $this;
}
public function getWebsite(): ?string
{
return $this->website;
}
public function setWebsite(?string $website): self
{
$this->website = $website;
return $this;
}
public function getEmail(): ?string
{
return $this->email;
}
public function setEmail(string $email): self
{
$this->email = $email;
return $this;
}
public function getFacebook(): ?string
{
return $this->facebook;
}
public function setFacebook(?string $facebook): self
{
$this->facebook = $facebook;
return $this;
}
public function getTwitter(): ?string
{
return $this->twitter;
}
public function setTwitter(?string $twitter): self
{
$this->twitter = $twitter;
return $this;
}
public function getLinkedin(): ?string
{
return $this->linkedin;
}
public function setLinkedin(?string $linkedin): self
{
$this->linkedin = $linkedin;
return $this;
}
public function getInstagram(): ?string
{
return $this->instagram;
}
public function setInstagram(?string $instagram): self
{
$this->instagram = $instagram;
return $this;
}
public function getPhone(): ?string
{
return $this->phone;
}
public function setPhone(?string $phone): self
{
$this->phone = $phone;
return $this;
}
public function getSubdomain(): ?string
{
return $this->subdomain;
}
public function setSubdomain(?string $subdomain): self
{
$this->subdomain = $subdomain;
return $this;
}
public function getDescription(): ?string
{
return $this->description;
}
public function setDescription(string $description): self
{
$this->description = $description;
return $this;
}
public function getFaq(): ?string
{
return $this->faq;
}
public function setFaq(?string $faq): self
{
$this->faq = $faq;
return $this;
}
public function getGdpr(): ?string
{
return $this->gdpr;
}
public function setGdpr(?string $gdpr): self
{
$this->gdpr = $gdpr;
return $this;
}
/**
* @return bool
*/
public function getFeatured(): bool {
return $this->featured;
}
/**
* @param bool $featured
*
* @return self
*/
public function setFeatured(bool $featured): self {
$this->featured = $featured;
return $this;
}
/**
* @return bool
*/
public function getAddon(): bool {
return $this->addon;
}
/**
* @param bool $addon
*
* @return self
*/
public function setAddon(bool $addon): self {
$this->addon = $addon;
return $this;
}
/**
* @return bool
*/
public function getNewsOption(): bool {
return $this->newsOption;
}
/**
* @param bool $newsOption
*
* @return self
*/
public function setNewsOption(bool $newsOption): self {
$this->newsOption = $newsOption;
return $this;
}
public function getBilling(): ?Billing
{
return $this->billing;
}
public function setBilling(?Billing $billing): self
{
$this->billing = $billing;
return $this;
}
/**
* @return Collection|JobPosition[]
*/
public function getJobPositions() {
return $this->jobPositions;
}
/**
* @return Collection|News[]
*/
public function getNews() {
return $this->news;
}
/**
* @param JobPosition $jobPosition
*
* @return Company
*/
public function addJobPosition(JobPosition $jobPosition): self
{
if (!$this->jobPositions->contains($jobPosition)) {
$this->jobPositions[] = $jobPosition;
}
return $this;
}
/**
* @param JobPosition $jobPosition
*
* @return Company
*/
public function removeJobPosition(JobPosition $jobPosition): self
{
if ($this->jobPositions->contains($jobPosition)) {
$this->jobPositions->removeElement($jobPosition);
}
return $this;
}
/**
* @return Collection|CompanySubscription[]
*/
public function getSubscriptions() {
return $this->subscriptions;
}
/**
* @return Collection|CompanySubscription[]
*/
public function getActiveSubscriptions() {
$activeSubscriptions = new ArrayCollection();
foreach ($this->subscriptions as $subscription) {
if ($subscription->isActive() && !$subscription->isExpired()) {
$paymentPlan = $subscription->getPaymentPlan();
$subscription->setExclusive($paymentPlan->isExclusive());
$subscription->setAddon($paymentPlan->isAddon());
$activeSubscriptions->add($subscription);
}
}
return $activeSubscriptions;
}
/**
* @return CompanySubscription
*/
public function getOneActiveSubscription() {
$activeSubscriptions = [];
if (count($this->subscriptions) > 0) {
$currentDate = new \DateTime;
foreach ($this->subscriptions as $subscription) {
if ($subscription->isActive() && !$subscription->isExpired() &&
($subscription->getValidTo() >= $currentDate || $subscription->getValidTo() == null) && $subscription->getCreatedAt() < $currentDate &&
($subscription->getOffers() > $subscription->getPublishedOffers() || $subscription->getOffers() == null)
) {
$paymentPlan = $subscription->getPaymentPlan();
if (!$paymentPlan->isPromotedJobPackage()) {
$subscription->setExclusive($paymentPlan->isExclusive());
$subscription->setAddon($paymentPlan->isAddon());
$subscription->planName = $paymentPlan->getName();
$subscription->planId = $paymentPlan->getId();
$activeSubscriptions[] = $subscription;
}
}
}
if (count($activeSubscriptions)) {
usort($activeSubscriptions, function ($b, $a) {
return $a->getCreatedAt() == $b->getCreatedAt() ? 0 : ($b->getCreatedAt() > $a->getCreatedAt() ? -1 : 1);
});
return $activeSubscriptions[0];
}
}
return count($activeSubscriptions) > 0 ? $activeSubscriptions[0] : null;
}
/**
* @param CompanySubscription $subscription
*
* @return Company
*/
public function addSubscription(CompanySubscription $subscription): self
{
if (!$this->subscriptions->contains($subscription)) {
$this->subscriptions[] = $subscription;
}
return $this;
}
/**
* @param CompanySubscription $subscription
*
* @return Company
*/
public function removeSubscription(CompanySubscription $subscription): self
{
if ($this->subscriptions->contains($subscription)) {
$this->subscriptions->removeElement($subscription);
}
return $this;
}
/**
* @return Collection|Candidate[]
*/
public function getFollowers(): Collection
{
return $this->followers;
}
/**
* @param Candidate $follower
*
* @return Company
*/
public function addFollower(Candidate $follower): self
{
if (!$this->followers->contains($follower)) {
$this->followers[] = $follower;
}
return $this;
}
/**
* @param Candidate $follower
*
* @return Company
*/
public function removeFollower(Candidate $follower): self
{
if ($this->followers->contains($follower)) {
$this->followers->removeElement($follower);
}
return $this;
}
/**
* @param ArrayCollection $followers
*
* @return Company
*/
public function setFollowers(ArrayCollection $followers): self
{
$this->followers = $followers;
return $this;
}
/**
* @return Collection|CompanyAdvantage[]
*/
public function getAdvantages()
{
$array = $this->advantages->toArray();
$arrayAdvantages = [];
foreach ($array as $key => $value) {
$arrayAdvantages[] = $value->advantage->getName();
}
return $arrayAdvantages;
}
/**
* @return Collection|CompanyAdvantage[]
*/
public function getAdvantagesCollection(): Collection
{
return $this->advantages;
}
/**
* @param CompanyAdvantage $advantage
*
* @return Company
*/
public function addAdvantage(CompanyAdvantage $advantage): self
{
if (!$this->advantages->contains($advantage)) {
$this->advantages[] = $advantage;
}
return $this;
}
/**
* @param CompanyAdvantage $advantage
*
* @return Company
*/
public function removeAdvantage(CompanyAdvantage $advantage): self
{
if ($this->advantages->contains($advantage)) {
$this->advantages->removeElement($advantage);
}
return $this;
}
/**
* @param ArrayCollection $advantages
*
* @return Company
*/
public function setAdvantages(ArrayCollection $advantages): self
{
$this->advantages = $advantages;
return $this;
}
/**
* @return File|null
*/
public function getLogo(){
return $this->getFileService()->getFile($this, self::FILE_LOGO);
}
public function setLogo(?UploadedFile $file){
if ($file) {
$oldFile = $this->getFileService()->getFile($this, self::FILE_LOGO);
$newFile = $this->getFileService()->upload($file, $this, self::FILE_LOGO, true, null, $this->getUser()->getId());
if($newFile && $oldFile){
$this->getFileService()->delete($oldFile);
}
}
return $this;
}
public function removeLogo(){
$file = $this->getFileService()->getFile($this, self::FILE_LOGO);
if($file) {
$this->getFileService()->delete($file);
}
return $this;
}
public function getCover(){
return $this->getFileService()->getFile($this, self::FILE_COVER);
}
public function setCover(?UploadedFile $file){
if ($file) {
$oldFile = $this->getFileService()->getFile($this, self::FILE_COVER);
$newFile = $this->getFileService()->upload($file, $this, self::FILE_COVER, true, null, $this->getUser()->getId());
if ($newFile && $oldFile){
$this->getFileService()->delete($oldFile);
}
}
return $this;
}
public function removeCover(){
$file = $this->getFileService()->getFile($this, self::FILE_COVER);
if ($file) {
$this->getFileService()->delete($file);
}
return $this;
}
public function getPdf(){
return $this->getFileService()->getFile($this, self::FILE_PDF);
}
public function setPdf(?UploadedFile $file){
if ($file) {
$oldFile = $this->getFileService()->getFile($this, self::FILE_PDF);
$newFile = $this->getFileService()->upload($file, $this, self::FILE_PDF);
if ($newFile && $oldFile){
$this->getFileService()->delete($oldFile);
}
}
return $this;
}
public function removePdf(){
$file = $this->getFileService()->getFile($this, self::FILE_PDF);
if ($file) {
$this->getFileService()->delete($file);
}
return $this;
}
public function getPdfPresence(){
if ($this->getFileService()->getFile($this, self::FILE_PDF)) {
$companyHasPdf = 'Yes';
return $companyHasPdf;
}
return null;
}
public function getStatus(): ?int
{
return $this->status;
}
public function setStatus(int $status): self
{
if (!array_key_exists($status, self::STATUSES)){
throw new ValidatorException("Company status is not valid");
}
$this->status = $status;
return $this;
}
/**
* @return bool
*/
public function getMkariera(): bool {
return $this->mkariera;
}
/**
* @param bool $mkariera
*
* @return self
*/
public function setMkariera(bool $mkariera): self {
$this->mkariera = $mkariera;
return $this;
}
public function getPublication(): ?string
{
return $this->publication;
}
public function setPublication(?string $publication): self
{
$this->publication = $publication;
return $this;
}
/**
* @return Collection|CompanyAboutUs[]
*/
public function getAboutUs(): Collection
{
return $this->aboutUs;
}
/**
* @param CompanyAboutUs $aboutus
*
* @return Company
*/
public function addAboutUs(CompanyAboutUs $aboutUs): self
{
if (!$this->aboutUs->contains($aboutUs)) {
$this->aboutUs[] = $aboutUs;
}
return $this;
}
/**
* @param CompanyAboutUs $aboutus
*
* @return Company
*/
public function removeAboutUs(CompanyAboutUs $aboutUs): self
{
if ($this->aboutUs->contains($aboutUs)) {
$this->aboutUs->removeElement($aboutUs);
}
return $this;
}
/**
* @param ArrayCollection $aboutUs
*
* @return Company
*/
public function setAboutUs(ArrayCollection $aboutUs): self
{
$this->aboutUs = $aboutUs;
return $this;
}
/**
* @return Collection|CompanyMosaic[]
*/
public function getMosaic(): Collection
{
return $this->mosaic;
}
/**
* @param CompanyMosaic $mosaic
*
* @return Company
*/
public function addMosaic(CompanyMosaic $mosaic): self
{
if (!$this->mosaic->contains($mosaic)) {
$this->mosaic[] = $mosaic;
}
return $this;
}
/**
* @param CompanyMosaic $mosaic
*
* @return Company
*/
public function removeMosaic(CompanyMosaic $mosaic): self
{
if ($this->mosaic->contains($mosaic)) {
$this->mosaic->removeElement($mosaic);
}
return $this;
}
/**
* @param ArrayCollection $mosaicCollection
*
* @return Company
*/
public function setMosaic(ArrayCollection $mosaicCollection): self
{
$this->mosaic = $mosaicCollection;
return $this;
}
/**
* @return Collection|CompanyGallery[]
*/
public function getGallery(): Collection
{
return $this->gallery;
}
/**
* @param CompanyGallery $gallery
*
* @return Company
*/
public function addGallery(CompanyGallery $gallery): self
{
if (!$this->gallery->contains($gallery)) {
$this->gallery[] = $gallery;
}
return $this;
}
/**
* @param CompanyGalery $gallery
*
* @return Company
*/
public function removeGallery(CompanyGallery $gallery): self
{
if ($this->gallery->contains($gallery)) {
$this->gallery->removeElement($gallery);
}
return $this;
}
/**
* @param ArrayCollection $galleryCollection
*
* @return Company
*/
public function setGallery(ArrayCollection $galleryCollection): self
{
$this->gallery = $galleryCollection;
return $this;
}
/**
* Get the value of coverThumbnail
*
* @return string|null
*/
public function getCoverThumbnail()
{
return $this->coverThumbnail;
}
/**
* Set the value of coverThumbnail
*
* @param string|null $coverThumbnail
*
* @return self
*/
public function setCoverThumbnail(?string $coverThumbnail)
{
$this->coverThumbnail = $coverThumbnail;
return $this;
}
/**
* Get the value of coverImageFile
*
* @return File|null
*/
public function getCoverImageFile()
{
return $this->coverImageFile;
}
/**
* Set the value of coverImageFile
*
* @return self
*/
public function setCoverImageFile(?UploadedFile $coverImageFile = null)
{
$this->coverImageFile = $coverImageFile;
if ($coverImageFile) {
$this->setCover($coverImageFile);
$this->imageUpdatedAt = (new \DateTime());
}
return $this;
}
/**
* Get the value of logoThumbnail
*
* @return string|null
*/
public function getLogoThumbnail()
{
return $this->logoThumbnail;
}
/**
* Set the value of logoThumbnail
*
* @param string|null $logoThumbnail
*
* @return self
*/
public function setLogoThumbnail($logoThumbnail)
{
$this->logoThumbnail = $logoThumbnail;
return $this;
}
/**
* Get the value of logoImageFile
*
* @return File|null
*/
public function getLogoImageFile()
{
return $this->logoImageFile;
}
/**
* Set the value of logoImageFile
*
* @return self
*/
public function setLogoImageFile(?UploadedFile $logoImageFile = null)
{
$this->logoImageFile = $logoImageFile;
if ($logoImageFile) {
$this->setLogo($logoImageFile);
$this->imageUpdatedAt = (new \DateTime());
}
return $this;
}
/**
* Get the value of imageUpdatedAt
*/
public function getImageUpdatedAt()
{
return $this->imageUpdatedAt;
}
/**
* Get the value of pdfPreview
*
* @return string|null
*/
public function getPdfPreview()
{
return $this->pdfPreview;
}
/**
* Set the value of pdfPreview
*
* @param string|null $pdfPreview
*
* @return self
*/
public function setPdfPreview($pdfPreview)
{
$this->pdfPreview = $pdfPreview;
return $this;
}
/**
* Get the value of pdfFile
*
* @return File|null
*/
public function getPdfFile()
{
return $this->pdfFile;
}
/**
* Set the value of pdfFile
*
* @return self
*/
public function setPdfFile(?UploadedFile $pdfFile = null)
{
$this->pdfFile = $pdfFile;
if ($pdfFile) {
$this->setPdf($pdfFile);
$this->imageUpdatedAt = (new \DateTime());
}
return $this;
}
public function __toString() {
return $this->getCompanyName();
}
public function sortCompanyAdvanteges($companyAdvantages) {
usort($companyAdvantages, function ($a, $b) {
return $a->getAdvantagePosition() == $b->getAdvantagePosition() ? 0 : ($b->getAdvantagePosition() > $a->getAdvantagePosition() ? -1 : 1);
});
return $companyAdvantages;
}
/**
* Specify data which should be serialized to JSON
*
* @link https://php.net/manual/en/jsonserializable.jsonserialize.php
* @return mixed data which can be serialized by <b>json_encode</b>,
* which is a value of any type other than a resource.
* @since 5.4.0
*/
public function jsonSerialize() {
return [
'id' => $this->getId(),
'companyName' => $this->getCompanyName(),
'industry' => $this->getIndustry()->getValues(),
'city' => $this->getCity(),
'address' => $this->getAddress(),
'companySize' => $this->getCompanySize(),
'employeesAverageSize' => $this->getEmployeesAverageSize(),
'website' => $this->getWebsite(),
'email' => $this->getEmail(),
'facebook' => $this->getFacebook(),
'twitter' => $this->getTwitter(),
'linkedin' => $this->getLinkedin(),
'instagram' => $this->getInstagram(),
'phone' => $this->getPhone(),
'subdomain' => $this->getSubdomain(),
'faq' => $this->getFaq(),
'gdpr' => $this->getGdpr(),
'featured' => $this->getFeatured(),
'description' => $this->getDescription(),
'billing' => $this->getBilling(),
'logo' => $this->getLogo(),
'cover' => $this->getCover(),
'pdf' => $this->getPdf(),
'status' => $this->getStatus(),
'newsOption' => $this->getNewsOption(),
'addon' => $this->getAddon(),
'publication' => $this->getPublication(),
'countActiveJobPositions' => $this->getJobPositions()->filter(function ($job) {return ($job->getStatus() === JobPosition::STATUS_ACTIVE && ($job->getValidTo() ? $job->getValidTo()->format('ymd') >= date('ymd') : false));})->count(),
'aboutus' => $this->getAboutUs()->filter(function ($aboutUs) {return $aboutUs->getActive();})->getValues(),
'advantages' => $this->sortCompanyAdvanteges($this->getAdvantagesCollection()->toArray()),
'mosaic' => $this->getMosaic()->filter(function ($mosaic) {return $mosaic->getActive();})->getValues(),
'gallery' => $this->getGallery()->filter(function ($gallery) {return $gallery->getActive();})->getValues(),
'countFollowers' => count($this->getFollowers()->getValues())
];
}
}