mirror of
https://gitlab.com/Chill-Projet/chill-bundles.git
synced 2025-06-07 18:44:08 +00:00
php code fix
This commit is contained in:
parent
9f7f6e33e8
commit
175fa7bf2f
@ -113,15 +113,6 @@ class AccompanyingPeriod implements
|
||||
*/
|
||||
public const STEP_DRAFT = 'DRAFT';
|
||||
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity=UserJob::class
|
||||
* )
|
||||
* @Groups({"read", "write"})
|
||||
*/
|
||||
private ?UserJob $job = null;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity=Address::class
|
||||
@ -208,6 +199,14 @@ class AccompanyingPeriod implements
|
||||
*/
|
||||
private $intensity = self::INTENSITY_OCCASIONAL;
|
||||
|
||||
/**
|
||||
* @ORM\ManyToOne(
|
||||
* targetEntity=UserJob::class
|
||||
* )
|
||||
* @Groups({"read", "write"})
|
||||
*/
|
||||
private ?UserJob $job = null;
|
||||
|
||||
/**
|
||||
* @var DateTime
|
||||
*
|
||||
@ -404,18 +403,6 @@ class AccompanyingPeriod implements
|
||||
return $array;
|
||||
}
|
||||
|
||||
public function getJob(): ?UserJob
|
||||
{
|
||||
return $this->job;
|
||||
}
|
||||
|
||||
public function setJob(?UserJob $job): self
|
||||
{
|
||||
$this->job = $job;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function addComment(Comment $comment): self
|
||||
{
|
||||
$this->comments[] = $comment;
|
||||
@ -647,6 +634,11 @@ class AccompanyingPeriod implements
|
||||
return $this->intensity;
|
||||
}
|
||||
|
||||
public function getJob(): ?UserJob
|
||||
{
|
||||
return $this->job;
|
||||
}
|
||||
|
||||
/**
|
||||
* Get the location, taking precedence into account.
|
||||
*
|
||||
@ -1080,6 +1072,13 @@ class AccompanyingPeriod implements
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function setJob(?UserJob $job): self
|
||||
{
|
||||
$this->job = $job;
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
/**
|
||||
* Set openingDate.
|
||||
*
|
||||
|
@ -15,10 +15,17 @@ use Doctrine\DBAL\Schema\Schema;
|
||||
use Doctrine\Migrations\AbstractMigration;
|
||||
|
||||
/**
|
||||
* Add userJob to AccompanyingPeriod
|
||||
* Add userJob to AccompanyingPeriod.
|
||||
*/
|
||||
final class Version20220119091025 extends AbstractMigration
|
||||
{
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT FK_E260A868BE04EA9');
|
||||
$this->addSql('DROP INDEX IDX_E260A868BE04EA9');
|
||||
$this->addSql('ALTER TABLE chill_person_accompanying_period DROP job_id');
|
||||
}
|
||||
|
||||
public function getDescription(): string
|
||||
{
|
||||
return 'Add userJob to AccompanyingPeriod';
|
||||
@ -30,11 +37,4 @@ final class Version20220119091025 extends AbstractMigration
|
||||
$this->addSql('ALTER TABLE chill_person_accompanying_period ADD CONSTRAINT FK_E260A868BE04EA9 FOREIGN KEY (job_id) REFERENCES chill_main_user_job (id) NOT DEFERRABLE INITIALLY IMMEDIATE');
|
||||
$this->addSql('CREATE INDEX IDX_E260A868BE04EA9 ON chill_person_accompanying_period (job_id)');
|
||||
}
|
||||
|
||||
public function down(Schema $schema): void
|
||||
{
|
||||
$this->addSql('ALTER TABLE chill_person_accompanying_period DROP CONSTRAINT FK_E260A868BE04EA9');
|
||||
$this->addSql('DROP INDEX IDX_E260A868BE04EA9');
|
||||
$this->addSql('ALTER TABLE chill_person_accompanying_period DROP job_id');
|
||||
}
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user