CoolCMS API

Company extends BaseEntity
in package
implements IdentifiableInterface uses IdentifiableTrait, TranslationCollectionTrait, AssetRelCollectionTrait

AbstractYes

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
template
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'
#[ExternalReadonly]

$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'
#[ExternalReadonly]

$email

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'
#[ExternalReadonly]

$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
#[ExternalReadonly]

$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

$updateDatetime

protected DateTime|null $updateDatetime = null
Attributes
#[Column]
$name: 'update_datetime'
$type: 'datetime'
$nullable: true
#[ExternalReadonly]

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
$this

addTranslation()

public addTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

callInitMethods()

Calls `init{TraitName}()` for every used trait that defines such a method.

public callInitMethods() : void

getActivated()

public getActivated() : bool
Return values
bool

getAllTraits()

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
bool

getBookingLeadTimeHours()

public getBookingLeadTimeHours() : int
Return values
int

getCity()

public getCity() : string|null
Return values
string|null

getCountry()

public getCountry() : string|null
Return values
string|null

getCountryCode()

public getCountryCode() : string|null
Return values
string|null

getCurrencyId()

public getCurrencyId() : int|null
Return values
int|null

getDefaultHourlyRate()

public getDefaultHourlyRate() : string|null
Return values
string|null

getDefaultSupplyKindId()

public getDefaultSupplyKindId() : int|null
Return values
int|null

getDefaultVatPercents()

public getDefaultVatPercents() : numeric-string|null
Return values
numeric-string|null

getDeleted()

public getDeleted() : bool
Return values
bool

getEmail()

public getEmail() : string|null
Return values
string|null

getFoundedDate()

public getFoundedDate() : DateTime|null
Return values
DateTime|null

getInsertDatetime()

public getInsertDatetime() : DateTime
Return values
DateTime

getInvoicerBillingLineId()

public getInvoicerBillingLineId() : int|null
Return values
int|null

getInvoicerInvoiceTypeId()

public getInvoicerInvoiceTypeId() : int|null
Return values
int|null

getInvoicerSellerId()

public getInvoicerSellerId() : int|null
Return values
int|null

getLogoImageId()

public getLogoImageId() : int|null
Return values
int|null

getName()

public getName() : string
Return values
string

getOpeningHours()

public getOpeningHours() : array<int|string, mixed>|null
Return values
array<int|string, mixed>|null

getOpeningHoursVo()

Returns the opening hours as a value object; the default basis of the booking calendar.

public getOpeningHoursVo() : OpeningHours
Return values
OpeningHours

getPhone()

public getPhone() : string|null
Return values
string|null

getPhotoImageId()

public getPhotoImageId() : int|null
Return values
int|null

getPostcode()

public getPostcode() : string|null
Return values
string|null

getPresented()

public getPresented() : bool
Return values
bool

getRatingEnabled()

public getRatingEnabled() : bool
Return values
bool

getRatingThreadId()

public getRatingThreadId() : int|null
Return values
int|null

getSlotLengthMinutes()

public getSlotLengthMinutes() : int
Return values
int

getStreet()

public getStreet() : string|null
Return values
string|null

getTranslation()

public getTranslation(int $langId) : TTranslation|null
Parameters
$langId : int
Return values
TTranslation|null

getTranslations()

public getTranslations() : Collection<int, TTranslation>
Return values
Collection<int, TTranslation>

getUpdateDatetime()

public getUpdateDatetime() : DateTime|null
Return values
DateTime|null

isActivated()

public isActivated() : bool
Return values
bool

isBookingEnabled()

public isBookingEnabled() : bool
Return values
bool

isDeleted()

public isDeleted() : bool
Return values
bool

isPresented()

public isPresented() : bool
Return values
bool

isRatingEnabled()

public isRatingEnabled() : bool
Return values
bool

removeAssetRel()

public removeAssetRel(TAssetRel $assetRel) : $this
Parameters
$assetRel : TAssetRel
Return values
$this

removeTranslation()

public removeTranslation(TTranslation $translation) : $this
Parameters
$translation : TTranslation
Return values
$this

setActivated()

public setActivated(bool $activated) : $this
Parameters
$activated : bool
Return values
$this

setAssetRels()

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
$this

setBookingEnabled()

public setBookingEnabled(bool $bookingEnabled) : $this
Parameters
$bookingEnabled : bool
Return values
$this

setBookingLeadTimeHours()

public setBookingLeadTimeHours(int $bookingLeadTimeHours) : $this
Parameters
$bookingLeadTimeHours : int
Return values
$this

setCity()

public setCity(string|null $city) : $this
Parameters
$city : string|null
Return values
$this

setCountry()

public setCountry(string|null $country) : $this
Parameters
$country : string|null
Return values
$this

setCountryCode()

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
$this

setDefaultHourlyRate()

public setDefaultHourlyRate(string|null $defaultHourlyRate) : $this
Parameters
$defaultHourlyRate : string|null
Return values
$this

setDefaultSupplyKindId()

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
$this

setDeleted()

public setDeleted(bool $deleted) : $this
Parameters
$deleted : bool
Return values
$this

setEmail()

public setEmail(string|null $email) : $this
Parameters
$email : string|null
Return values
$this

setFoundedDate()

public setFoundedDate(DateTime|null $foundedDate) : $this
Parameters
$foundedDate : DateTime|null
Return values
$this

setId()

public setId(int|null $id) : $this
Parameters
$id : int|null
Return values
$this

setInsertDatetime()

public setInsertDatetime(DateTime $insertDatetime) : $this
Parameters
$insertDatetime : DateTime
Return values
$this

setInvoicerBillingLineId()

public setInvoicerBillingLineId(int|null $invoicerBillingLineId) : $this
Parameters
$invoicerBillingLineId : int|null
Return values
$this

setInvoicerInvoiceTypeId()

public setInvoicerInvoiceTypeId(int|null $invoicerInvoiceTypeId) : $this
Parameters
$invoicerInvoiceTypeId : int|null
Return values
$this

setInvoicerSellerId()

public setInvoicerSellerId(int|null $invoicerSellerId) : $this
Parameters
$invoicerSellerId : int|null
Return values
$this

setLogoImageId()

public setLogoImageId(int|null $logoImageId) : $this
Parameters
$logoImageId : int|null
Return values
$this

setName()

public setName(string $name) : $this
Parameters
$name : string
Return values
$this

setOpeningHours()

public setOpeningHours(array<int|string, mixed>|null $openingHours) : $this
Parameters
$openingHours : array<int|string, mixed>|null
Return values
$this

setPhone()

public setPhone(string|null $phone) : $this
Parameters
$phone : string|null
Return values
$this

setPhotoImageId()

public setPhotoImageId(int|null $photoImageId) : $this
Parameters
$photoImageId : int|null
Return values
$this

setPostcode()

public setPostcode(string|null $postcode) : $this
Parameters
$postcode : string|null
Return values
$this

setPresented()

public setPresented(bool $presented) : $this
Parameters
$presented : bool
Return values
$this

setRatingEnabled()

public setRatingEnabled(bool $ratingEnabled) : $this
Parameters
$ratingEnabled : bool
Return values
$this

setRatingThreadId()

public setRatingThreadId(int|null $ratingThreadId) : $this
Parameters
$ratingThreadId : int|null
Return values
$this

setSlotLengthMinutes()

public setSlotLengthMinutes(int $slotLengthMinutes) : $this
Parameters
$slotLengthMinutes : int
Return values
$this

setStreet()

public setStreet(string|null $street) : $this
Parameters
$street : string|null
Return values
$this

setTranslations()

public setTranslations(Collection<int, TTranslation>|array<int, TTranslation> $translations) : $this
Parameters
$translations : Collection<int, TTranslation>|array<int, TTranslation>
Return values
$this

setUpdateDatetime()

public setUpdateDatetime(DateTime|null $updateDatetime) : $this
Parameters
$updateDatetime : DateTime|null
Return values
$this

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>
Return values
array<string, string>
On this page

Search results