Skip to content

Commit

Permalink
Release 2.0.31 (kimai#4245)
Browse files Browse the repository at this point in the history
* replace strings by class references
* allow 64 chars for username
* fix time can be optional and null
* fix timezone is not respected
* bump version
* fix br in attribute
* support different visible duration from booked duration
* fix image URL
  • Loading branch information
kevinpapst authored Aug 21, 2023
1 parent 3e61e0d commit a392f61
Show file tree
Hide file tree
Showing 36 changed files with 169 additions and 94 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,7 @@
</p>

<p align="center">
<a href="https://github.com/kimai/kimai/actions"><img alt="CI Status" src="https://github.com/kimai/kimai/workflows/CI/badge.svg"></a>
<a href="https://github.com/kimai/kimai/actions"><img alt="CI Status" src="https://github.com/kimai/kimai/actions/workflows/testing.yaml/badge.svg"></a>
<a href="https://codecov.io/gh/kimai/kimai"><img alt="Code Coverage" src="https://codecov.io/gh/kimai/kimai/branch/main/graph/badge.svg"></a>
<a href="https://packagist.org/packages/kimai/kimai"><img alt="Latest stable version" src="https://poser.pugx.org/kimai/kimai/v/stable"></a>
<a href="https://www.gnu.org/licenses/agpl-3.0.en.html"><img alt="License" src="https://poser.pugx.org/kimai/kimai/license"></a>
Expand Down
4 changes: 2 additions & 2 deletions src/Constants.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,11 +17,11 @@ class Constants
/**
* The current release version
*/
public const VERSION = '2.0.30';
public const VERSION = '2.0.31';
/**
* The current release: major * 10000 + minor * 100 + patch
*/
public const VERSION_ID = 20030;
public const VERSION_ID = 20031;
/**
* The software name
*/
Expand Down
8 changes: 4 additions & 4 deletions src/Entity/Activity.php
Original file line number Diff line number Diff line change
Expand Up @@ -43,8 +43,8 @@ class Activity implements EntityWithMetaFields, EntityWithBudget
#[Serializer\Groups(['Default'])]
#[Exporter\Expose(label: 'id', type: 'integer')]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Project')]
#[ORM\JoinColumn(onDelete: 'CASCADE')]
#[ORM\ManyToOne(targetEntity: Project::class)]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: true)]
#[Serializer\Expose]
#[Serializer\Groups(['Subresource', 'Expanded'])]
#[OA\Property(ref: '#/components/schemas/ProjectExpanded')]
Expand Down Expand Up @@ -87,7 +87,7 @@ class Activity implements EntityWithMetaFields, EntityWithBudget
*
* @var Collection<ActivityMeta>
*/
#[ORM\OneToMany(targetEntity: 'App\Entity\ActivityMeta', mappedBy: 'activity', cascade: ['persist'])]
#[ORM\OneToMany(targetEntity: ActivityMeta::class, mappedBy: 'activity', cascade: ['persist'])]
#[Serializer\Expose]
#[Serializer\Groups(['Activity'])]
#[Serializer\Type(name: 'array<App\Entity\ActivityMeta>')]
Expand All @@ -102,7 +102,7 @@ class Activity implements EntityWithMetaFields, EntityWithBudget
#[ORM\JoinTable(name: 'kimai2_activities_teams')]
#[ORM\JoinColumn(name: 'activity_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\InverseJoinColumn(name: 'team_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\ManyToMany(targetEntity: 'App\Entity\Team', cascade: ['persist'], inversedBy: 'activities')]
#[ORM\ManyToMany(targetEntity: Team::class, cascade: ['persist'], inversedBy: 'activities')]
#[Serializer\Expose]
#[Serializer\Groups(['Activity'])]
#[OA\Property(type: 'array', items: new OA\Items(ref: '#/components/schemas/Team'))]
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/ActivityMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ActivityMeta implements MetaTableTypeInterface
{
use MetaTableTypeTrait;

#[ORM\ManyToOne(targetEntity: 'App\Entity\Activity', inversedBy: 'meta')]
#[ORM\ManyToOne(targetEntity: Activity::class, inversedBy: 'meta')]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
private ?Activity $activity = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/ActivityRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ActivityRate implements RateInterface
{
use Rate;

#[ORM\ManyToOne(targetEntity: 'App\Entity\Activity')]
#[ORM\ManyToOne(targetEntity: Activity::class)]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
private ?Activity $activity = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Bookmark.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class Bookmark
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User')]
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
private ?User $user = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/CommentTableTypeTrait.php
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ trait CommentTableTypeTrait
#[ORM\Column(name: 'message', type: 'text', nullable: false)]
#[Assert\NotNull]
private ?string $message = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User')]
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
private ?User $createdBy = null;
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -156,7 +156,7 @@ class Customer implements EntityWithMetaFields, EntityWithBudget
*
* @var Collection<CustomerMeta>
*/
#[ORM\OneToMany(targetEntity: 'App\Entity\CustomerMeta', mappedBy: 'customer', cascade: ['persist'])]
#[ORM\OneToMany(targetEntity: CustomerMeta::class, mappedBy: 'customer', cascade: ['persist'])]
#[Serializer\Expose]
#[Serializer\Groups(['Customer'])]
#[Serializer\Type(name: 'array<App\Entity\CustomerMeta>')]
Expand All @@ -171,15 +171,15 @@ class Customer implements EntityWithMetaFields, EntityWithBudget
#[ORM\JoinTable(name: 'kimai2_customers_teams')]
#[ORM\JoinColumn(name: 'customer_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\InverseJoinColumn(name: 'team_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\ManyToMany(targetEntity: 'App\Entity\Team', cascade: ['persist'], inversedBy: 'customers')]
#[ORM\ManyToMany(targetEntity: Team::class, cascade: ['persist'], inversedBy: 'customers')]
#[Serializer\Expose]
#[Serializer\Groups(['Customer'])]
#[OA\Property(type: 'array', items: new OA\Items(ref: '#/components/schemas/Team'))]
private Collection $teams;
/**
* Default invoice template for this customer
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\InvoiceTemplate')]
#[ORM\ManyToOne(targetEntity: InvoiceTemplate::class)]
#[ORM\JoinColumn(onDelete: 'SET NULL', nullable: true)]
private ?InvoiceTemplate $invoiceTemplate = null;
#[ORM\Column(name: 'invoice_text', type: 'text', nullable: true)]
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/CustomerComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class CustomerComment implements CommentInterface
{
use CommentTableTypeTrait;

#[ORM\ManyToOne(targetEntity: 'App\Entity\Customer')]
#[ORM\ManyToOne(targetEntity: Customer::class)]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
private Customer $customer;
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/CustomerMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class CustomerMeta implements MetaTableTypeInterface
{
use MetaTableTypeTrait;

#[ORM\ManyToOne(targetEntity: 'App\Entity\Customer', inversedBy: 'meta')]
#[ORM\ManyToOne(targetEntity: Customer::class, inversedBy: 'meta')]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
private ?Customer $customer = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/CustomerRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class CustomerRate implements RateInterface
{
use Rate;

#[ORM\ManyToOne(targetEntity: 'App\Entity\Customer')]
#[ORM\ManyToOne(targetEntity: Customer::class)]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
private ?Customer $customer = null;
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/Invoice.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,11 +55,11 @@ class Invoice implements EntityWithMetaFields
#[Serializer\Groups(['Customer_Entity'])]
#[Exporter\Expose(label: 'comment')]
private ?string $comment = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Customer')]
#[ORM\ManyToOne(targetEntity: Customer::class)]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
private ?Customer $customer = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User')]
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
private ?User $user = null;
Expand Down Expand Up @@ -109,7 +109,7 @@ class Invoice implements EntityWithMetaFields
*
* @var Collection<InvoiceMeta>
*/
#[ORM\OneToMany(targetEntity: 'App\Entity\InvoiceMeta', mappedBy: 'invoice', cascade: ['persist'])]
#[ORM\OneToMany(targetEntity: InvoiceMeta::class, mappedBy: 'invoice', cascade: ['persist'])]
#[Serializer\Expose]
#[Serializer\Groups(['Invoice'])]
#[Serializer\Type(name: 'array<App\Entity\InvoiceMeta>')]
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/InvoiceMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class InvoiceMeta implements MetaTableTypeInterface
{
use MetaTableTypeTrait;

#[ORM\ManyToOne(targetEntity: 'App\Entity\Invoice', inversedBy: 'meta')]
#[ORM\ManyToOne(targetEntity: Invoice::class, inversedBy: 'meta')]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
private ?Invoice $invoice = null;
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/Project.php
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ class Project implements EntityWithMetaFields, EntityWithBudget
/**
* Customer for this project
*/
#[ORM\ManyToOne(targetEntity: 'App\Entity\Customer')]
#[ORM\ManyToOne(targetEntity: Customer::class)]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
#[Serializer\Expose]
Expand Down Expand Up @@ -137,7 +137,7 @@ class Project implements EntityWithMetaFields, EntityWithBudget
*
* @var Collection<ProjectMeta>
*/
#[ORM\OneToMany(targetEntity: 'App\Entity\ProjectMeta', mappedBy: 'project', cascade: ['persist'])]
#[ORM\OneToMany(targetEntity: ProjectMeta::class, mappedBy: 'project', cascade: ['persist'])]
#[Serializer\Expose]
#[Serializer\Groups(['Project'])]
#[Serializer\Type(name: 'array<App\Entity\ProjectMeta>')]
Expand All @@ -152,7 +152,7 @@ class Project implements EntityWithMetaFields, EntityWithBudget
#[ORM\JoinTable(name: 'kimai2_projects_teams')]
#[ORM\JoinColumn(name: 'project_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\InverseJoinColumn(name: 'team_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\ManyToMany(targetEntity: 'App\Entity\Team', cascade: ['persist'], inversedBy: 'projects')]
#[ORM\ManyToMany(targetEntity: Team::class, cascade: ['persist'], inversedBy: 'projects')]
#[Serializer\Expose]
#[Serializer\Groups(['Project'])]
#[OA\Property(type: 'array', items: new OA\Items(ref: '#/components/schemas/Team'))]
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/ProjectComment.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ class ProjectComment implements CommentInterface
{
use CommentTableTypeTrait;

#[ORM\ManyToOne(targetEntity: 'App\Entity\Project')]
#[ORM\ManyToOne(targetEntity: Project::class)]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
private Project $project;
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/ProjectMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class ProjectMeta implements MetaTableTypeInterface
{
use MetaTableTypeTrait;

#[ORM\ManyToOne(targetEntity: 'App\Entity\Project', inversedBy: 'meta')]
#[ORM\ManyToOne(targetEntity: Project::class, inversedBy: 'meta')]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
private ?Project $project = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/ProjectRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class ProjectRate implements RateInterface
{
use Rate;

#[ORM\ManyToOne(targetEntity: 'App\Entity\Project')]
#[ORM\ManyToOne(targetEntity: Project::class)]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
private ?Project $project = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Rate.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ trait Rate
#[Serializer\Expose]
#[Serializer\Groups(['Default'])]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User')]
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: true)]
#[Serializer\Expose]
#[Serializer\Groups(['Default'])]
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/RolePermission.php
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,7 @@ class RolePermission
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Role')]
#[ORM\ManyToOne(targetEntity: Role::class)]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
private ?Role $role = null;
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/Tag.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,7 +54,7 @@ class Tag
/**
* @var Collection<Timesheet>
*/
#[ORM\ManyToMany(targetEntity: 'App\Entity\Timesheet', mappedBy: 'tags', fetch: 'EXTRA_LAZY')]
#[ORM\ManyToMany(targetEntity: Timesheet::class, mappedBy: 'tags', fetch: 'EXTRA_LAZY')]
private Collection $timesheets;

public function __construct()
Expand Down
4 changes: 2 additions & 2 deletions src/Entity/TeamMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,14 +25,14 @@ class TeamMember
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User', inversedBy: 'memberships')]
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'memberships')]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
#[Serializer\Expose]
#[Serializer\Groups(['Default', 'Entity', 'Team_Entity'])]
#[OA\Property(ref: '#/components/schemas/User')]
private ?User $user = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Team', inversedBy: 'members')]
#[ORM\ManyToOne(targetEntity: Team::class, inversedBy: 'members')]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
#[Serializer\Expose]
Expand Down
10 changes: 5 additions & 5 deletions src/Entity/Timesheet.php
Original file line number Diff line number Diff line change
Expand Up @@ -127,21 +127,21 @@ class Timesheet implements EntityWithMetaFields, ExportableItem
#[Serializer\Expose]
#[Serializer\Groups(['Default'])]
private ?int $duration = 0;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User')]
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(name: '`user`', referencedColumnName: 'id', onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
#[Serializer\Expose]
#[Serializer\Groups(['Subresource', 'Expanded'])]
#[OA\Property(ref: '#/components/schemas/User')]
private ?User $user = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Activity')]
#[ORM\ManyToOne(targetEntity: Activity::class)]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
#[Serializer\Expose]
#[Serializer\Groups(['Subresource', 'Expanded'])]
#[OA\Property(ref: '#/components/schemas/ActivityExpanded')]
private ?Activity $activity = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\Project')]
#[ORM\ManyToOne(targetEntity: Project::class)]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
#[Serializer\Expose]
Expand Down Expand Up @@ -203,15 +203,15 @@ class Timesheet implements EntityWithMetaFields, ExportableItem
#[ORM\JoinTable(name: 'kimai2_timesheet_tags')]
#[ORM\JoinColumn(name: 'timesheet_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\InverseJoinColumn(name: 'tag_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
#[ORM\ManyToMany(targetEntity: 'App\Entity\Tag', inversedBy: 'timesheets', cascade: ['persist'])]
#[ORM\ManyToMany(targetEntity: Tag::class, inversedBy: 'timesheets', cascade: ['persist'])]
#[Assert\Valid]
private Collection $tags;
/**
* Meta fields registered with the timesheet
*
* @var Collection<TimesheetMeta>
*/
#[ORM\OneToMany(targetEntity: 'App\Entity\TimesheetMeta', mappedBy: 'timesheet', cascade: ['persist'])]
#[ORM\OneToMany(targetEntity: TimesheetMeta::class, mappedBy: 'timesheet', cascade: ['persist'])]
#[Serializer\Expose]
#[Serializer\Groups(['Timesheet'])]
#[Serializer\Type(name: 'array<App\Entity\TimesheetMeta>')]
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/TimesheetMeta.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,7 +22,7 @@ class TimesheetMeta implements MetaTableTypeInterface
{
use MetaTableTypeTrait;

#[ORM\ManyToOne(targetEntity: 'App\Entity\Timesheet', inversedBy: 'meta')]
#[ORM\ManyToOne(targetEntity: Timesheet::class, inversedBy: 'meta')]
#[ORM\JoinColumn(onDelete: 'CASCADE', nullable: false)]
#[Assert\NotNull]
private ?Timesheet $timesheet = null;
Expand Down
6 changes: 3 additions & 3 deletions src/Entity/User.php
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ class User implements UserInterface, EquatableInterface, ThemeUserInterface, Pas
#[ORM\Column(name: 'username', type: 'string', length: 180, nullable: false)]
#[Assert\NotBlank(groups: ['Registration', 'UserCreate', 'Profile'])]
#[Assert\Regex(pattern: '/\//', match: false, groups: ['Registration', 'UserCreate', 'Profile'])]
#[Assert\Length(min: 2, max: 60, groups: ['Registration', 'UserCreate', 'Profile'])]
#[Assert\Length(min: 2, max: 64, groups: ['Registration', 'UserCreate', 'Profile'])]
#[Serializer\Expose]
#[Serializer\Groups(['Default'])]
private ?string $username = null;
Expand Down Expand Up @@ -1253,9 +1253,9 @@ public function setPublicHolidayGroup(null|string $group = null): void
$this->setPreferenceValue(UserPreference::PUBLIC_HOLIDAY_GROUP, $group);
}

public function setHolidaysPerYear(int $holidays): void
public function setHolidaysPerYear(?int $holidays): void
{
$this->setPreferenceValue(UserPreference::HOLIDAYS_PER_YEAR, $holidays);
$this->setPreferenceValue(UserPreference::HOLIDAYS_PER_YEAR, $holidays ?? 0);
}

public function hasContractSettings(): bool
Expand Down
2 changes: 1 addition & 1 deletion src/Entity/UserPreference.php
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ class UserPreference
#[ORM\GeneratedValue]
#[ORM\Column(name: 'id', type: 'integer')]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User', inversedBy: 'preferences')]
#[ORM\ManyToOne(targetEntity: User::class, inversedBy: 'preferences')]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
#[Assert\NotNull]
private ?User $user = null;
Expand Down
4 changes: 2 additions & 2 deletions src/Entity/WorkingTime.php
Original file line number Diff line number Diff line change
Expand Up @@ -25,7 +25,7 @@ class WorkingTime
#[ORM\GeneratedValue]
#[ORM\Column(name: 'id', type: 'integer')]
private ?int $id = null;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User')]
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(nullable: false, onDelete: 'CASCADE')]
#[Assert\NotNull]
private ?User $user = null;
Expand All @@ -38,7 +38,7 @@ class WorkingTime
#[ORM\Column(name: 'actual', type: 'integer', nullable: false)]
#[Assert\NotNull]
private int $actualTime = 0;
#[ORM\ManyToOne(targetEntity: 'App\Entity\User')]
#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(name: 'approved_by', nullable: true, onDelete: 'SET NULL')]
private ?User $approvedBy = null;
#[ORM\Column(name: 'approved_at', type: 'datetime', nullable: true)]
Expand Down
Loading

0 comments on commit a392f61

Please sign in to comment.