Company
in package
implements
ResourceInterface
uses
IdentifiableTrait, TimestampableTrait, ApprovableTrait, UpdateProposableTrait
Company model.
Attributes
- #[Entity]
- #[HasLifecycleCallbacks]
Table of Contents
Interfaces
- ResourceInterface
Properties
- $approvableText : ApprovableText|null
- When the entity has been approved/rejected a message can be attached. Since we do not always need this message it has been replaced with another entity which we can EXTRA_LAZY load to ensure it is not always included.
- $approved : ApprovableStatus
- State of the approval.
- $approvedAt : DateTime|null
- The date when the entity was approved.
- $approver : Member|null
- Who (dis)approved the entity using this trait?
- $contactAddress : string|null
- The company's contact address.
- $contactEmail : string|null
- The company's contact email address.
- $contactName : string|null
- The company's contact's name.
- $contactPhone : string|null
- The company's contact phone.
- $createdAt : DateTime
- The date at which the entity was created.
- $description : CompanyLocalisedText
- Company description.
- $id : int|null
- The default value must be `null` to prevent issues with auto generating the value. The column is strictly not nullable.
- $isUpdate : bool
- Whether this entity is a proposed update for another entity.
- $logo : string|null
- Company logo.
- $name : string
- The company's display name.
- $packages : Collection<string|int, CompanyPackage>
- The company's packages.
- $published : bool
- Whether the company is published or not.
- $representativeEmail : string
- The email address of the person representing the company. Is used for communications with the company.
- $representativeName : string
- The name of the person representing the company. Is used for communications with the company.
- $slogan : CompanyLocalisedText
- Company slogan.
- $slugName : string
- The company's slug version of the name. (username).
- $updatedAt : DateTime
- The date at which the entity was updated.
- $updateProposals : Collection<string|int, CompanyUpdate>
- Proposed updates to this company.
- $website : CompanyLocalisedText
- Company website.
Methods
- __construct() : mixed
- exchangeArray() : void
- Updates this object with values in the form of getArrayCopy(). This does not include the logo.
- getApprovableText() : ApprovableText|null
- getApproved() : ApprovableStatus
- getApprovedAt() : DateTime|null
- getApprover() : Member|null
- getContactAddress() : string|null
- Get the company's address.
- getContactEmail() : string|null
- Get the company's email.
- getContactName() : string|null
- Get the company's contact's name.
- getContactPhone() : string|null
- Get the company's phone.
- getCreatedAt() : DateTime
- getDescription() : CompanyLocalisedText
- Get the company's description.
- getId() : int|null
- Get the identifier of the object.
- getIsUpdate() : bool
- Get whether this is a proposed update.
- getLogo() : string|null
- Get the company's logo.
- getName() : string
- Get the company's name.
- getNumberOfActiveJobs() : int
- Returns the number of jobs that are contained in all active packages of this company.
- getNumberOfExpiredPackages() : int
- Returns the number of expired packages.
- getNumberOfJobs() : int
- Returns the number of jobs that are contained in all packages of this company.
- getNumberOfPackages() : int
- Get the number of packages.
- getPackages() : Collection<string|int, CompanyPackage>
- Get the company's packages.
- getRepresentativeEmail() : string
- Get the email address of the person representing the company.
- getRepresentativeName() : string
- Get the name of the person representing the company.
- getResourceId() : string
- getSlogan() : CompanyLocalisedText
- Get the company's slogan.
- getSlugName() : string
- Gets the company's slug name.
- getUpdatedAt() : DateTime
- getUpdateProposals() : Collection<string|int, CompanyUpdate>
- getWebsite() : CompanyLocalisedText
- Get the company's website.
- isApproved() : bool
- isBannerActive() : bool
- Returns true if a banner is active, and false when there is no banner active.
- isFeatured() : bool
- Returns true if company is featured.
- isHidden() : bool
- Return true if the company should not be visible to the user, and false if it should be visible to the user.
- isPublished() : bool
- Get the company's hidden status.
- isUpdate() : bool
- Get whether this is a proposed update.
- prePersist() : void
- Automatically fill in the `DateTime`s before the initial call to `persist()`.
- preUpdate() : void
- Automatically update the `updatedAt` `DateTime` when doing an update to the entity.
- setApprovableText() : void
- setApproved() : void
- setApprovedAt() : void
- setApprover() : void
- setContactAddress() : void
- Set the company's address.
- setContactEmail() : void
- Set the company's email.
- setContactName() : void
- Set the company's contact's name.
- setContactPhone() : void
- Set the company's phone.
- setDescription() : void
- Set the company's description.
- setId() : void
- Setting the identifier manually will, in most instances, result in undefined behaviour. Use with caution!
- setIsUpdate() : void
- Set whether this is a proposed update.
- setLogo() : void
- Set the company's logo.
- setName() : void
- Set the company's name.
- setPublished() : void
- Set the company's hidden status.
- setRepresentativeEmail() : void
- Set the email address of the person representing the company.
- setRepresentativeName() : void
- Set the name of the person representing the company.
- setSlogan() : void
- Set the company's slogan.
- setSlugName() : void
- Sets the company's slug name.
- setWebsite() : void
- Set the company's description.
- toArray() : array{name: string, slugName: string, representativeName: string, representativeEmail: string, logo: ?string, contactName: ?string, contactEmail: ?string, contactAddress: ?string, contactPhone: ?string, published: bool, slogan: ?string, sloganEn: ?string, website: ?string, websiteEn: ?string, description: ?string, descriptionEn: ?string}
- Returns an array copy with all attributes.
- toGdprArray() : ApprovableTraitGdprArrayType
- setCreatedAt() : void
- setUpdatedAt() : void
Properties
$approvableText
When the entity has been approved/rejected a message can be attached. Since we do not always need this message it has been replaced with another entity which we can EXTRA_LAZY load to ensure it is not always included.
protected
ApprovableText|null
$approvableText
= null
Attributes
- #[JoinColumn]
- $name: 'approvableText_id'
- $referencedColumnName: 'id'
- $nullable: true
- #[OneToOne]
- $targetEntity: \Application\Model\ApprovableText::class
- $cascade: ['persist', 'remove']
- $fetch: 'EXTRA_LAZY'
- $orphanRemoval: true
$approved
State of the approval.
protected
ApprovableStatus
$approved
Attributes
- #[Column]
- $type: 'integer'
- $enumType: \Application\Model\Enums\ApprovableStatus::class
$approvedAt
The date when the entity was approved.
protected
DateTime|null
$approvedAt
= null
Attributes
- #[Column]
- $type: 'datetime'
- $nullable: true
$approver
Who (dis)approved the entity using this trait?
protected
Member|null
$approver
= null
Attributes
- #[JoinColumn]
- $referencedColumnName: 'lidnr'
- #[ManyToOne]
- $targetEntity: \Decision\Model\Member::class
$contactAddress
The company's contact address.
protected
string|null
$contactAddress
Attributes
- #[Column]
- $type: 'string'
- $nullable: true
$contactEmail
The company's contact email address.
protected
string|null
$contactEmail
Attributes
- #[Column]
- $type: 'string'
- $nullable: true
$contactName
The company's contact's name.
protected
string|null
$contactName
Attributes
- #[Column]
- $type: 'string'
- $nullable: true
$contactPhone
The company's contact phone.
protected
string|null
$contactPhone
Attributes
- #[Column]
- $type: 'string'
- $nullable: true
$createdAt
The date at which the entity was created.
protected
DateTime
$createdAt
Attributes
- #[Column]
- $type: 'datetime'
$description
Company description.
protected
CompanyLocalisedText
$description
Attributes
- #[JoinColumn]
- $name: 'description_id'
- $referencedColumnName: 'id'
- $nullable: false
- #[OneToOne]
- $targetEntity: \Company\Model\CompanyLocalisedText::class
- $cascade: ['persist', 'remove']
- $orphanRemoval: true
$id
The default value must be `null` to prevent issues with auto generating the value. The column is strictly not nullable.
protected
int|null
$id
= null
Attributes
- #[Column]
- $type: 'integer'
- #[GeneratedValue]
- $strategy: 'IDENTITY'
- #[Id]
$isUpdate
Whether this entity is a proposed update for another entity.
protected
bool
$isUpdate
= false
Attributes
- #[Column]
- $type: 'boolean'
$logo
Company logo.
protected
string|null
$logo
= null
Attributes
- #[Column]
- $type: 'string'
- $nullable: true
$name
The company's display name.
protected
string
$name
Attributes
- #[Column]
- $type: 'string'
$packages
The company's packages.
protected
Collection<string|int, CompanyPackage>
$packages
Attributes
- #[OneToMany]
- $targetEntity: \Company\Model\CompanyPackage::class
- $mappedBy: 'company'
- $cascade: ['persist', 'remove']
$published
Whether the company is published or not.
protected
bool
$published
Attributes
- #[Column]
- $type: 'boolean'
$representativeEmail
The email address of the person representing the company. Is used for communications with the company.
protected
string
$representativeEmail
Attributes
- #[Column]
- $type: 'string'
$representativeName
The name of the person representing the company. Is used for communications with the company.
protected
string
$representativeName
Attributes
- #[Column]
- $type: 'string'
$slogan
Company slogan.
protected
CompanyLocalisedText
$slogan
Attributes
- #[JoinColumn]
- $name: 'slogan_id'
- $referencedColumnName: 'id'
- $nullable: false
- #[OneToOne]
- $targetEntity: \Company\Model\CompanyLocalisedText::class
- $cascade: ['persist', 'remove']
- $orphanRemoval: true
$slugName
The company's slug version of the name. (username).
protected
string
$slugName
Attributes
- #[Column]
- $type: 'string'
$updatedAt
The date at which the entity was updated.
protected
DateTime
$updatedAt
Attributes
- #[Column]
- $type: 'datetime'
$updateProposals
Proposed updates to this company.
protected
Collection<string|int, CompanyUpdate>
$updateProposals
Attributes
- #[OneToMany]
- $targetEntity: \Company\Model\Proposals\CompanyUpdate::class
- $mappedBy: 'original'
- $fetch: 'EXTRA_LAZY'
$website
Company website.
protected
CompanyLocalisedText
$website
Attributes
- #[JoinColumn]
- $name: 'website_id'
- $referencedColumnName: 'id'
- $nullable: false
- #[OneToOne]
- $targetEntity: \Company\Model\CompanyLocalisedText::class
- $cascade: ['persist', 'remove']
- $orphanRemoval: true
Methods
__construct()
public
__construct() : mixed
exchangeArray()
Updates this object with values in the form of getArrayCopy(). This does not include the logo.
public
exchangeArray(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
Tags
getApprovableText()
public
getApprovableText() : ApprovableText|null
Return values
ApprovableText|nullgetApproved()
public
getApproved() : ApprovableStatus
Return values
ApprovableStatusgetApprovedAt()
public
getApprovedAt() : DateTime|null
Return values
DateTime|nullgetApprover()
public
getApprover() : Member|null
Return values
Member|nullgetContactAddress()
Get the company's address.
public
getContactAddress() : string|null
Return values
string|nullgetContactEmail()
Get the company's email.
public
getContactEmail() : string|null
Return values
string|nullgetContactName()
Get the company's contact's name.
public
getContactName() : string|null
Return values
string|nullgetContactPhone()
Get the company's phone.
public
getContactPhone() : string|null
Return values
string|nullgetCreatedAt()
public
getCreatedAt() : DateTime
Return values
DateTimegetDescription()
Get the company's description.
public
getDescription() : CompanyLocalisedText
Return values
CompanyLocalisedTextgetId()
Get the identifier of the object.
public
getId() : int|null
Tags
Return values
int|nullgetIsUpdate()
Get whether this is a proposed update.
public
getIsUpdate() : bool
Return values
boolgetLogo()
Get the company's logo.
public
getLogo() : string|null
Return values
string|nullgetName()
Get the company's name.
public
getName() : string
Return values
stringgetNumberOfActiveJobs()
Returns the number of jobs that are contained in all active packages of this company.
public
getNumberOfActiveJobs([JobCategory|null $category = null ]) : int
Parameters
- $category : JobCategory|null = null
Return values
intgetNumberOfExpiredPackages()
Returns the number of expired packages.
public
getNumberOfExpiredPackages() : int
Return values
intgetNumberOfJobs()
Returns the number of jobs that are contained in all packages of this company.
public
getNumberOfJobs() : int
Return values
intgetNumberOfPackages()
Get the number of packages.
public
getNumberOfPackages() : int
Return values
int —the number of packages
getPackages()
Get the company's packages.
public
getPackages() : Collection<string|int, CompanyPackage>
Return values
Collection<string|int, CompanyPackage>getRepresentativeEmail()
Get the email address of the person representing the company.
public
getRepresentativeEmail() : string
Return values
stringgetRepresentativeName()
Get the name of the person representing the company.
public
getRepresentativeName() : string
Return values
stringgetResourceId()
public
getResourceId() : string
Return values
stringgetSlogan()
Get the company's slogan.
public
getSlogan() : CompanyLocalisedText
Return values
CompanyLocalisedTextgetSlugName()
Gets the company's slug name.
public
getSlugName() : string
Return values
string —the company's slug name
getUpdatedAt()
public
getUpdatedAt() : DateTime
Return values
DateTimegetUpdateProposals()
public
getUpdateProposals() : Collection<string|int, CompanyUpdate>
Return values
Collection<string|int, CompanyUpdate>getWebsite()
Get the company's website.
public
getWebsite() : CompanyLocalisedText
Return values
CompanyLocalisedTextisApproved()
public
isApproved() : bool
Return values
boolisBannerActive()
Returns true if a banner is active, and false when there is no banner active.
public
isBannerActive() : bool
Return values
boolisFeatured()
Returns true if company is featured.
public
isFeatured() : bool
Return values
boolisHidden()
Return true if the company should not be visible to the user, and false if it should be visible to the user.
public
isHidden() : bool
Return values
boolisPublished()
Get the company's hidden status.
public
isPublished() : bool
Return values
boolisUpdate()
Get whether this is a proposed update.
public
isUpdate() : bool
Return values
boolprePersist()
Automatically fill in the `DateTime`s before the initial call to `persist()`.
public
prePersist() : void
Attributes
- #[PrePersist]
preUpdate()
Automatically update the `updatedAt` `DateTime` when doing an update to the entity.
public
preUpdate() : void
Attributes
- #[PreUpdate]
setApprovableText()
public
setApprovableText(ApprovableText|null $approvableText) : void
Parameters
- $approvableText : ApprovableText|null
setApproved()
public
setApproved(ApprovableStatus $approved) : void
Parameters
- $approved : ApprovableStatus
setApprovedAt()
public
setApprovedAt(DateTime|null $approvedAt) : void
Parameters
- $approvedAt : DateTime|null
setApprover()
public
setApprover(Member|null $approver) : void
Parameters
- $approver : Member|null
setContactAddress()
Set the company's address.
public
setContactAddress(string|null $contactAddress) : void
Parameters
- $contactAddress : string|null
setContactEmail()
Set the company's email.
public
setContactEmail(string|null $contactEmail) : void
Parameters
- $contactEmail : string|null
setContactName()
Set the company's contact's name.
public
setContactName(string|null $name) : void
Parameters
- $name : string|null
setContactPhone()
Set the company's phone.
public
setContactPhone(string|null $contactPhone) : void
Parameters
- $contactPhone : string|null
setDescription()
Set the company's description.
public
setDescription(CompanyLocalisedText $description) : void
Parameters
- $description : CompanyLocalisedText
setId()
Setting the identifier manually will, in most instances, result in undefined behaviour. Use with caution!
public
setId(int|null $id) : void
Parameters
- $id : int|null
setIsUpdate()
Set whether this is a proposed update.
public
setIsUpdate(bool $isUpdate) : void
Parameters
- $isUpdate : bool
setLogo()
Set the company's logo.
public
setLogo(string|null $logo) : void
Parameters
- $logo : string|null
setName()
Set the company's name.
public
setName(string $name) : void
Parameters
- $name : string
setPublished()
Set the company's hidden status.
public
setPublished(bool $published) : void
Parameters
- $published : bool
setRepresentativeEmail()
Set the email address of the person representing the company.
public
setRepresentativeEmail(string $email) : void
Parameters
- $email : string
setRepresentativeName()
Set the name of the person representing the company.
public
setRepresentativeName(string $name) : void
Parameters
- $name : string
setSlogan()
Set the company's slogan.
public
setSlogan(CompanyLocalisedText $slogan) : void
Parameters
- $slogan : CompanyLocalisedText
setSlugName()
Sets the company's slug name.
public
setSlugName(string $slugName) : void
Parameters
- $slugName : string
-
the new slug name
setWebsite()
Set the company's description.
public
setWebsite(CompanyLocalisedText $website) : void
Parameters
- $website : CompanyLocalisedText
toArray()
Returns an array copy with all attributes.
public
toArray() : array{name: string, slugName: string, representativeName: string, representativeEmail: string, logo: ?string, contactName: ?string, contactEmail: ?string, contactAddress: ?string, contactPhone: ?string, published: bool, slogan: ?string, sloganEn: ?string, website: ?string, websiteEn: ?string, description: ?string, descriptionEn: ?string}
Return values
array{name: string, slugName: string, representativeName: string, representativeEmail: string, logo: ?string, contactName: ?string, contactEmail: ?string, contactAddress: ?string, contactPhone: ?string, published: bool, slogan: ?string, sloganEn: ?string, website: ?string, websiteEn: ?string, description: ?string, descriptionEn: ?string}toGdprArray()
public
toGdprArray() : ApprovableTraitGdprArrayType
Return values
ApprovableTraitGdprArrayTypesetCreatedAt()
private
setCreatedAt(DateTime $createdAt) : void
Parameters
- $createdAt : DateTime
setUpdatedAt()
private
setUpdatedAt(DateTime $updatedAt) : void
Parameters
- $updatedAt : DateTime