CompanyJobPackage
extends CompanyPackage
in package
CompanyPackage model.
Attributes
- #[Entity]
Table of Contents
Properties
- $company : Company
- The package's company.
- $contractNumber : string|null
- An alphanumeric strings which identifies to which contract this package belongs.
- $expires : DateTime
- The package's expiration date.
- $id : int|null
- The default value must be `null` to prevent issues with auto generating the value. The column is strictly not nullable.
- $jobs : Collection<string|int, Job>
- The package's jobs.
- $published : bool
- The package's published state.
- $starts : DateTime
- The package's starting date.
Methods
- __construct() : mixed
- addJob() : void
- Adds a job to the package.
- exchangeArray() : void
- getCompany() : Company
- Get the package's company.
- getContractNumber() : string|null
- getExpirationDate() : DateTime
- Get the package's expiration date.
- getId() : int|null
- Get the identifier of the object.
- getJobs() : Collection<string|int, Job>
- Get the jobs in the package.
- getJobsInCategory() : array<string|int, Job>
- Get the jobs that are part of the given category.
- getJobsWithoutProposals() : Collection<string|int, Job>
- Get the jobs in the package, but without any that are actually update proposals.
- getNumberOfActiveJobs() : int
- Get the number of jobs in the package.
- getStartingDate() : DateTime
- Get the package's starting date.
- getType() : CompanyPackageTypes
- Gets the type of the package.
- isActive() : bool
- isExpired() : bool
- Check whether this package is expired.
- isPublished() : bool
- Get the package's publish state.
- removeJob() : void
- Removes a job from the package.
- setCompany() : void
- Set the package's company.
- setContractNumber() : void
- setExpirationDate() : void
- Set the package's expiration date.
- setId() : void
- Setting the identifier manually will, in most instances, result in undefined behaviour. Use with caution!
- setPublished() : void
- Set the package's publish state.
- setStartingDate() : void
- Set the package's starting date.
- toArray() : array{contractNumber: ?string, startDate: string, expirationDate: string, published: bool}
Properties
$company
The package's company.
protected
Company
$company
Attributes
- #[ManyToOne]
- $targetEntity: \Company\Model\Company::class
- $inversedBy: 'packages'
$contractNumber
An alphanumeric strings which identifies to which contract this package belongs.
protected
string|null
$contractNumber
= null
Attributes
- #[Column]
- $type: 'string'
- $nullable: true
$expires
The package's expiration date.
protected
DateTime
$expires
Attributes
- #[Column]
- $type: 'date'
$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]
$jobs
The package's jobs.
protected
Collection<string|int, Job>
$jobs
Attributes
- #[OneToMany]
- $targetEntity: \Company\Model\Job::class
- $mappedBy: 'package'
- $cascade: ['persist', 'remove']
- #[OrderBy]
- ['updatedAt' => 'DESC']
$published
The package's published state.
protected
bool
$published
Attributes
- #[Column]
- $type: 'boolean'
$starts
The package's starting date.
protected
DateTime
$starts
Attributes
- #[Column]
- $type: 'date'
Methods
__construct()
public
__construct() : mixed
addJob()
Adds a job to the package.
public
addJob(Job $job) : void
Parameters
- $job : Job
-
job to be added
exchangeArray()
public
exchangeArray(array<string|int, mixed> $data) : void
Parameters
- $data : array<string|int, mixed>
Tags
getCompany()
Get the package's company.
public
getCompany() : Company
Return values
CompanygetContractNumber()
public
getContractNumber() : string|null
Return values
string|nullgetExpirationDate()
Get the package's expiration date.
public
getExpirationDate() : DateTime
Return values
DateTimegetId()
Get the identifier of the object.
public
getId() : int|null
Tags
Return values
int|nullgetJobs()
Get the jobs in the package.
public
getJobs() : Collection<string|int, Job>
Return values
Collection<string|int, Job>getJobsInCategory()
Get the jobs that are part of the given category.
public
getJobsInCategory([JobCategory|null $category = null ]) : array<string|int, Job>
Parameters
- $category : JobCategory|null = null
Return values
array<string|int, Job>getJobsWithoutProposals()
Get the jobs in the package, but without any that are actually update proposals.
public
getJobsWithoutProposals() : Collection<string|int, Job>
Return values
Collection<string|int, Job>getNumberOfActiveJobs()
Get the number of jobs in the package.
public
getNumberOfActiveJobs([JobCategory|null $category = null ]) : int
Parameters
- $category : JobCategory|null = null
Return values
int —of jobs in the package
getStartingDate()
Get the package's starting date.
public
getStartingDate() : DateTime
Return values
DateTimegetType()
Gets the type of the package.
public
getType() : CompanyPackageTypes
Return values
CompanyPackageTypesisActive()
public
isActive() : bool
Return values
boolisExpired()
Check whether this package is expired.
public
isExpired() : bool
Return values
boolisPublished()
Get the package's publish state.
public
isPublished() : bool
Return values
boolremoveJob()
Removes a job from the package.
public
removeJob(Job $job) : void
Parameters
- $job : Job
-
job to be removed
setCompany()
Set the package's company.
public
setCompany(Company $company) : void
Parameters
- $company : Company
setContractNumber()
public
setContractNumber(string|null $contractNumber) : void
Parameters
- $contractNumber : string|null
setExpirationDate()
Set the package's expiration date.
public
setExpirationDate(DateTime $expires) : void
Parameters
- $expires : DateTime
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
setPublished()
Set the package's publish state.
public
setPublished(bool $published) : void
Parameters
- $published : bool
setStartingDate()
Set the package's starting date.
public
setStartingDate(DateTime $starts) : void
Parameters
- $starts : DateTime
toArray()
public
toArray() : array{contractNumber: ?string, startDate: string, expirationDate: string, published: bool}