Company
extends BaseEntity
in package
implements
IdentifiableInterface
uses
IdentifiableTrait, TranslationCollectionTrait, AssetRelCollectionTrait
Own company of the operator: back-office data plus the presentation profile.
There can be many rows but exactly one is presented; the Api CompanyManager enforces
that exclusivity, the entity only carries the flag.
The profile gallery (assetRels, photos and videos) is written through
$meta['orderedAssets']; the first item in the order is main and is copied to
photoImageId (the hero photo). Same model as Reference: the main image is kept in a
plain FK column instead of an ORM association
(CompanyManager::getMainAssetColumn()).
The logo channel (logoImageId) holds a single image and is outside the gallery.
Tags
Attributes
- #[MappedSuperclass]
- #[TableAlias]
- $alias: 'company'
Table of Contents
Interfaces
- IdentifiableInterface
- Entity with a simple integer primary key. Most entities have one (often via {@see \App\Core\Traits\Shared\Models\Entities\IdentifiableTrait}); texts and links with a composite key do not, which is why `getId()` is not on {@see \App\Core\Base\BaseEntity}. Code that needs the id of a generic entity asks for this interface (parameter type, template bound, `instanceof`).
Properties
- $activated : bool
- $assetRels : Collection<int, TAssetRel>
- $bookingEnabled : bool
- $bookingLeadTimeHours : int
- $city : string|null
- $country : string|null
- $countryCode : string|null
- $currencyId : int|null
- $defaultHourlyRate : string|null
- $defaultSupplyKindId : int|null
- $defaultVatPercents : numeric-string|null
- $deleted : bool
- $email : string|null
- $foundedDate : DateTime|null
- $id : int|null
- $insertDatetime : DateTime
- $invoicerBillingLineId : int|null
- $invoicerInvoiceTypeId : int|null
- $invoicerSellerId : int|null
- $logoImageId : int|null
- $name : string
- $openingHours : array<int|string, mixed>|null
- $phone : string|null
- $photoImageId : int|null
- $postcode : string|null
- $presented : bool
- $ratingEnabled : bool
- $ratingThreadId : int|null
- $slotLengthMinutes : int
- $street : string|null
- $translations : Collection<int, TTranslation>
- $updateDatetime : DateTime|null
Methods
- __construct() : mixed
- addAssetRel() : $this
- addTranslation() : $this
- assetRelCollectionInit() : void
- callInitMethods() : void
- Calls `init{TraitName}()` for every used trait that defines such a method.
- getActivated() : bool
- getAllTraits() : array<string, string>
- Returns all traits the class uses, including those used by parent classes and nested traits.
- getAssetRels() : Collection<int, TAssetRel>
- getAssets() : array<int, mixed>
- Assets of the non-removed rels, ordered by `order` — whatever the rel's untyped `getAsset()` holds (asset entity, or null).
- getBookingEnabled() : bool
- getBookingLeadTimeHours() : int
- getCity() : string|null
- getCountry() : string|null
- getCountryCode() : string|null
- getCurrencyId() : int|null
- getDefaultHourlyRate() : string|null
- getDefaultSupplyKindId() : int|null
- getDefaultVatPercents() : numeric-string|null
- getDeleted() : bool
- getEmail() : string|null
- getFoundedDate() : DateTime|null
- getId() : int|null
- getInsertDatetime() : DateTime
- getInvoicerBillingLineId() : int|null
- getInvoicerInvoiceTypeId() : int|null
- getInvoicerSellerId() : int|null
- getLogoImageId() : int|null
- getMainAsset() : Asset|null
- getName() : string
- getOpeningHours() : array<int|string, mixed>|null
- getOpeningHoursVo() : OpeningHours
- Returns the opening hours as a value object; the default basis of the booking calendar.
- getPhone() : string|null
- getPhotoImageId() : int|null
- getPostcode() : string|null
- getPresented() : bool
- getRatingEnabled() : bool
- getRatingThreadId() : int|null
- getSlotLengthMinutes() : int
- getStreet() : string|null
- getTranslation() : TTranslation|null
- getTranslations() : Collection<int, TTranslation>
- getUpdateDatetime() : DateTime|null
- isActivated() : bool
- isBookingEnabled() : bool
- isDeleted() : bool
- isPersisted() : bool
- isPresented() : bool
- isRatingEnabled() : bool
- removeAssetRel() : $this
- removeTranslation() : $this
- setActivated() : $this
- setAssetRels() : $this
- IMPORTANT: the parameter type must be `Collection`, not `ArrayCollection`; the keep branch of the Api `SaveTrait` can pass a `PersistentCollection` from a managed entity, and a narrower type would throw a `TypeError` and fail the save.
- setBookingEnabled() : $this
- setBookingLeadTimeHours() : $this
- setCity() : $this
- setCountry() : $this
- setCountryCode() : TAssetRel>
- setCurrencyId() : $this
- setDefaultHourlyRate() : $this
- setDefaultSupplyKindId() : TAssetRel>
- setDefaultVatPercents() : $this
- setDeleted() : $this
- setEmail() : $this
- setFoundedDate() : $this
- setId() : $this
- setInsertDatetime() : $this
- setInvoicerBillingLineId() : $this
- setInvoicerInvoiceTypeId() : $this
- setInvoicerSellerId() : $this
- setLogoImageId() : $this
- setName() : $this
- setOpeningHours() : $this
- setPhone() : $this
- setPhotoImageId() : $this
- setPostcode() : $this
- setPresented() : $this
- setRatingEnabled() : $this
- setRatingThreadId() : $this
- setSlotLengthMinutes() : $this
- setStreet() : $this
- setTranslations() : $this
- setUpdateDatetime() : $this
- translationCollectionInit() : void
- getTraitsRecursive() : array<string, string>
- Walks the trait list recursively and collects nested traits too.
Properties
$activated
protected
bool
$activated
= false
Attributes
- #[Column]
- $name: 'activated'
- $type: 'boolean'
$assetRels
protected
Collection<int, TAssetRel>
$assetRels
= new ArrayCollection()
$bookingEnabled
protected
bool
$bookingEnabled
= false
Attributes
- #[Column]
- $name: 'booking_enabled'
- $type: 'boolean'
$bookingLeadTimeHours
protected
int
$bookingLeadTimeHours
= 24
Attributes
- #[Column]
- $name: 'booking_lead_time_hours'
- $type: 'smallint'
- $options: ['unsigned' => true, 'default' => 24]
$city
protected
string|null
$city
= null
Attributes
- #[Column]
- $name: 'city'
- $type: 'string'
- $length: 255
- $nullable: true
$country
protected
string|null
$country
= null
Attributes
- #[Column]
- $name: 'country'
- $type: 'string'
- $length: 100
- $nullable: true
$countryCode
protected
string|null
$countryCode
= null
Attributes
- #[Column]
- $name: 'country_code'
- $type: 'string'
- $length: 2
- $nullable: true
- $options: ['fixed' => true]
$currencyId
protected
int|null
$currencyId
= null
Attributes
- #[Column]
- $name: 'cms_system_currencies_currency_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $nullable: true
$defaultHourlyRate
protected
string|null
$defaultHourlyRate
= null
Attributes
- #[Column]
- $name: 'default_hourly_rate'
- $type: 'decimal'
- $precision: 10
- $scale: 2
- $nullable: true
$defaultSupplyKindId
protected
int|null
$defaultSupplyKindId
= null
Attributes
- #[Column]
- $name: 'default_supply_kind_id'
- $type: 'integer'
- $nullable: true
- $options: ['unsigned' => true]
$defaultVatPercents
protected
numeric-string|null
$defaultVatPercents
= null
Attributes
- #[Column]
- $name: 'default_vat_percents'
- $type: 'decimal'
- $precision: 5
- $scale: 2
- $nullable: true
$deleted
protected
bool
$deleted
= false
Attributes
- #[Column]
- $name: 'deleted'
- $type: 'boolean'
protected
string|null
$email
= null
Attributes
- #[Column]
- $name: 'email'
- $type: 'string'
- $length: 255
- $nullable: true
$foundedDate
protected
DateTime|null
$foundedDate
= null
Attributes
- #[Column]
- $name: 'founded_date'
- $type: 'date'
- $nullable: true
$id
protected
int|null
$id
= null
Attributes
- #[Column]
- $name: 'company_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- #[GeneratedValue]
- #[Id]
$insertDatetime
protected
DateTime
$insertDatetime
= new DateTime()
Attributes
- #[Column]
- $name: 'insert_datetime'
- $type: 'datetime'
$invoicerBillingLineId
protected
int|null
$invoicerBillingLineId
= null
Attributes
- #[Column]
- $name: 'invoicer_billing_line_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $nullable: true
$invoicerInvoiceTypeId
protected
int|null
$invoicerInvoiceTypeId
= null
Attributes
- #[Column]
- $name: 'invoicer_invoice_type_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $nullable: true
$invoicerSellerId
protected
int|null
$invoicerSellerId
= null
Attributes
- #[Column]
- $name: 'invoicer_seller_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $nullable: true
$logoImageId
protected
int|null
$logoImageId
= null
Attributes
- #[Column]
- $name: 'logo_image_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $nullable: true
$name
protected
string
$name
= ''
Attributes
- #[Column]
- $name: 'name'
- $type: 'string'
- $length: 255
$openingHours
protected
array<int|string, mixed>|null
$openingHours
= null
JSON, serialized form of OpeningHours
Attributes
- #[Column]
- $name: 'opening_hours'
- $type: 'json'
- $nullable: true
$phone
protected
string|null
$phone
= null
Attributes
- #[Column]
- $name: 'phone'
- $type: 'string'
- $length: 255
- $nullable: true
$photoImageId
protected
int|null
$photoImageId
= null
Attributes
- #[Column]
- $name: 'photo_image_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $nullable: true
$postcode
protected
string|null
$postcode
= null
Attributes
- #[Column]
- $name: 'postcode'
- $type: 'string'
- $length: 20
- $nullable: true
$presented
protected
bool
$presented
= false
Attributes
- #[Column]
- $name: 'presented'
- $type: 'boolean'
$ratingEnabled
protected
bool
$ratingEnabled
= true
Attributes
- #[Column]
- $name: 'rating_enabled'
- $type: 'boolean'
$ratingThreadId
protected
int|null
$ratingThreadId
= null
Attributes
- #[Column]
- $name: 'rating_thread_id'
- $type: 'integer'
- $options: ['unsigned' => true]
- $nullable: true
$slotLengthMinutes
protected
int
$slotLengthMinutes
= 60
Attributes
- #[Column]
- $name: 'slot_length_minutes'
- $type: 'smallint'
- $options: ['unsigned' => true, 'default' => 60]
$street
protected
string|null
$street
= null
Attributes
- #[Column]
- $name: 'street'
- $type: 'string'
- $length: 255
- $nullable: true
$translations
protected
Collection<int, TTranslation>
$translations
$updateDatetime
protected
DateTime|null
$updateDatetime
= null
Attributes
- #[Column]
- $name: 'update_datetime'
- $type: 'datetime'
- $nullable: true
Methods
__construct()
public
__construct([int|null $id = null ][, string $name = '' ][, bool $presented = false ][, int|null $invoicerSellerId = null ][, int|null $invoicerBillingLineId = null ][, int|null $invoicerInvoiceTypeId = null ][, string|null $defaultHourlyRate = null ][, string|null $defaultVatPercents = null ][, int|null $currencyId = null ][, string|null $email = null ][, string|null $phone = null ][, string|null $street = null ][, string|null $city = null ][, string|null $postcode = null ][, string|null $country = null ][, string|null $countryCode = null ][, DateTime|null $foundedDate = null ][, array<string|int, mixed>|null $openingHours = null ][, int $slotLengthMinutes = 60 ][, int $bookingLeadTimeHours = 24 ][, int|null $logoImageId = null ][, int|null $photoImageId = null ][, bool $bookingEnabled = false ][, bool $ratingEnabled = true ][, int|null $ratingThreadId = null ][, bool $activated = false ][, bool $deleted = false ][, DateTime $insertDatetime = new DateTime() ][, DateTime|null $updateDatetime = null ][, Collection $assetRels = new ArrayCollection() ][, int|null $defaultSupplyKindId = null ]) : mixed
Parameters
- $id : int|null = null
- $name : string = ''
- $presented : bool = false
- $invoicerSellerId : int|null = null
- $invoicerBillingLineId : int|null = null
- $invoicerInvoiceTypeId : int|null = null
- $defaultHourlyRate : string|null = null
- $defaultVatPercents : string|null = null
- $currencyId : int|null = null
- $email : string|null = null
- $phone : string|null = null
- $street : string|null = null
- $city : string|null = null
- $postcode : string|null = null
- $country : string|null = null
- $countryCode : string|null = null
- $foundedDate : DateTime|null = null
- $openingHours : array<string|int, mixed>|null = null
- $slotLengthMinutes : int = 60
- $bookingLeadTimeHours : int = 24
- $logoImageId : int|null = null
- $photoImageId : int|null = null
- $bookingEnabled : bool = false
- $ratingEnabled : bool = true
- $ratingThreadId : int|null = null
- $activated : bool = false
- $deleted : bool = false
- $insertDatetime : DateTime = new DateTime()
- $updateDatetime : DateTime|null = null
- $assetRels : Collection = new ArrayCollection()
- $defaultSupplyKindId : int|null = null
addAssetRel()
public
addAssetRel(TAssetRel $assetRel) : $this
Parameters
- $assetRel : TAssetRel
Return values
$thisaddTranslation()
public
addTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thisassetRelCollectionInit()
public
assetRelCollectionInit() : void
callInitMethods()
Calls `init{TraitName}()` for every used trait that defines such a method.
public
callInitMethods() : void
getActivated()
public
getActivated() : bool
Return values
boolgetAllTraits()
Returns all traits the class uses, including those used by parent classes and nested traits.
public
getAllTraits() : array<string, string>
Return values
array<string, string>getAssetRels()
public
getAssetRels() : Collection<int, TAssetRel>
Return values
Collection<int, TAssetRel>getAssets()
Assets of the non-removed rels, ordered by `order` — whatever the rel's untyped `getAsset()` holds (asset entity, or null).
public
getAssets() : array<int, mixed>
Return values
array<int, mixed>getBookingEnabled()
public
getBookingEnabled() : bool
Return values
boolgetBookingLeadTimeHours()
public
getBookingLeadTimeHours() : int
Return values
intgetCity()
public
getCity() : string|null
Return values
string|nullgetCountry()
public
getCountry() : string|null
Return values
string|nullgetCountryCode()
public
getCountryCode() : string|null
Return values
string|nullgetCurrencyId()
public
getCurrencyId() : int|null
Return values
int|nullgetDefaultHourlyRate()
public
getDefaultHourlyRate() : string|null
Return values
string|nullgetDefaultSupplyKindId()
public
getDefaultSupplyKindId() : int|null
Return values
int|nullgetDefaultVatPercents()
public
getDefaultVatPercents() : numeric-string|null
Return values
numeric-string|nullgetDeleted()
public
getDeleted() : bool
Return values
boolgetEmail()
public
getEmail() : string|null
Return values
string|nullgetFoundedDate()
public
getFoundedDate() : DateTime|null
Return values
DateTime|nullgetId()
public
getId() : int|null
Return values
int|nullgetInsertDatetime()
public
getInsertDatetime() : DateTime
Return values
DateTimegetInvoicerBillingLineId()
public
getInvoicerBillingLineId() : int|null
Return values
int|nullgetInvoicerInvoiceTypeId()
public
getInvoicerInvoiceTypeId() : int|null
Return values
int|nullgetInvoicerSellerId()
public
getInvoicerSellerId() : int|null
Return values
int|nullgetLogoImageId()
public
getLogoImageId() : int|null
Return values
int|nullgetMainAsset()
public
getMainAsset() : Asset|null
Return values
Asset|null —main image (else the first non-removed one)
getName()
public
getName() : string
Return values
stringgetOpeningHours()
public
getOpeningHours() : array<int|string, mixed>|null
Return values
array<int|string, mixed>|nullgetOpeningHoursVo()
Returns the opening hours as a value object; the default basis of the booking calendar.
public
getOpeningHoursVo() : OpeningHours
Return values
OpeningHoursgetPhone()
public
getPhone() : string|null
Return values
string|nullgetPhotoImageId()
public
getPhotoImageId() : int|null
Return values
int|nullgetPostcode()
public
getPostcode() : string|null
Return values
string|nullgetPresented()
public
getPresented() : bool
Return values
boolgetRatingEnabled()
public
getRatingEnabled() : bool
Return values
boolgetRatingThreadId()
public
getRatingThreadId() : int|null
Return values
int|nullgetSlotLengthMinutes()
public
getSlotLengthMinutes() : int
Return values
intgetStreet()
public
getStreet() : string|null
Return values
string|nullgetTranslation()
public
getTranslation(int $langId) : TTranslation|null
Parameters
- $langId : int
Return values
TTranslation|nullgetTranslations()
public
getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>getUpdateDatetime()
public
getUpdateDatetime() : DateTime|null
Return values
DateTime|nullisActivated()
public
isActivated() : bool
Return values
boolisBookingEnabled()
public
isBookingEnabled() : bool
Return values
boolisDeleted()
public
isDeleted() : bool
Return values
boolisPersisted()
public
isPersisted() : bool
Return values
boolisPresented()
public
isPresented() : bool
Return values
boolisRatingEnabled()
public
isRatingEnabled() : bool
Return values
boolremoveAssetRel()
public
removeAssetRel(TAssetRel $assetRel) : $this
Parameters
- $assetRel : TAssetRel
Return values
$thisremoveTranslation()
public
removeTranslation(TTranslation $translation) : $this
Parameters
- $translation : TTranslation
Return values
$thissetActivated()
public
setActivated(bool $activated) : $this
Parameters
- $activated : bool
Return values
$thissetAssetRels()
IMPORTANT: the parameter type must be `Collection`, not `ArrayCollection`; the keep branch of the Api `SaveTrait` can pass a `PersistentCollection` from a managed entity, and a narrower type would throw a `TypeError` and fail the save.
public
setAssetRels(Collection<int, TAssetRel> $assetRels) : $this
Parameters
- $assetRels : Collection<int, TAssetRel>
Return values
$thissetBookingEnabled()
public
setBookingEnabled(bool $bookingEnabled) : $this
Parameters
- $bookingEnabled : bool
Return values
$thissetBookingLeadTimeHours()
public
setBookingLeadTimeHours(int $bookingLeadTimeHours) : $this
Parameters
- $bookingLeadTimeHours : int
Return values
$thissetCity()
public
setCity(string|null $city) : $this
Parameters
- $city : string|null
Return values
$thissetCountry()
public
setCountry(string|null $country) : $this
Parameters
- $country : string|null
Return values
$thissetCountryCode()
public
setCountryCode(string|null $countryCode) : TAssetRel>
Parameters
- $countryCode : string|null
Return values
TAssetRel>setCurrencyId()
public
setCurrencyId(int|null $currencyId) : $this
Parameters
- $currencyId : int|null
Return values
$thissetDefaultHourlyRate()
public
setDefaultHourlyRate(string|null $defaultHourlyRate) : $this
Parameters
- $defaultHourlyRate : string|null
Return values
$thissetDefaultSupplyKindId()
public
setDefaultSupplyKindId(int|null $defaultSupplyKindId) : TAssetRel>
Parameters
- $defaultSupplyKindId : int|null
Return values
TAssetRel>setDefaultVatPercents()
public
setDefaultVatPercents(int|float|string|null $defaultVatPercents) : $this
Parameters
- $defaultVatPercents : int|float|string|null
Return values
$thissetDeleted()
public
setDeleted(bool $deleted) : $this
Parameters
- $deleted : bool
Return values
$thissetEmail()
public
setEmail(string|null $email) : $this
Parameters
- $email : string|null
Return values
$thissetFoundedDate()
public
setFoundedDate(DateTime|null $foundedDate) : $this
Parameters
- $foundedDate : DateTime|null
Return values
$thissetId()
public
setId(int|null $id) : $this
Parameters
- $id : int|null
Return values
$thissetInsertDatetime()
public
setInsertDatetime(DateTime $insertDatetime) : $this
Parameters
- $insertDatetime : DateTime
Return values
$thissetInvoicerBillingLineId()
public
setInvoicerBillingLineId(int|null $invoicerBillingLineId) : $this
Parameters
- $invoicerBillingLineId : int|null
Return values
$thissetInvoicerInvoiceTypeId()
public
setInvoicerInvoiceTypeId(int|null $invoicerInvoiceTypeId) : $this
Parameters
- $invoicerInvoiceTypeId : int|null
Return values
$thissetInvoicerSellerId()
public
setInvoicerSellerId(int|null $invoicerSellerId) : $this
Parameters
- $invoicerSellerId : int|null
Return values
$thissetLogoImageId()
public
setLogoImageId(int|null $logoImageId) : $this
Parameters
- $logoImageId : int|null
Return values
$thissetName()
public
setName(string $name) : $this
Parameters
- $name : string
Return values
$thissetOpeningHours()
public
setOpeningHours(array<int|string, mixed>|null $openingHours) : $this
Parameters
- $openingHours : array<int|string, mixed>|null
Return values
$thissetPhone()
public
setPhone(string|null $phone) : $this
Parameters
- $phone : string|null
Return values
$thissetPhotoImageId()
public
setPhotoImageId(int|null $photoImageId) : $this
Parameters
- $photoImageId : int|null
Return values
$thissetPostcode()
public
setPostcode(string|null $postcode) : $this
Parameters
- $postcode : string|null
Return values
$thissetPresented()
public
setPresented(bool $presented) : $this
Parameters
- $presented : bool
Return values
$thissetRatingEnabled()
public
setRatingEnabled(bool $ratingEnabled) : $this
Parameters
- $ratingEnabled : bool
Return values
$thissetRatingThreadId()
public
setRatingThreadId(int|null $ratingThreadId) : $this
Parameters
- $ratingThreadId : int|null
Return values
$thissetSlotLengthMinutes()
public
setSlotLengthMinutes(int $slotLengthMinutes) : $this
Parameters
- $slotLengthMinutes : int
Return values
$thissetStreet()
public
setStreet(string|null $street) : $this
Parameters
- $street : string|null
Return values
$thissetTranslations()
public
setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
- $translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$thissetUpdateDatetime()
public
setUpdateDatetime(DateTime|null $updateDatetime) : $this
Parameters
- $updateDatetime : DateTime|null
Return values
$thistranslationCollectionInit()
public
translationCollectionInit() : void
getTraitsRecursive()
Walks the trait list recursively and collects nested traits too.
private
static getTraitsRecursive(array<string, string> $traits) : array<string, string>
Parameters
- $traits : array<string, string>