Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
118 changes: 118 additions & 0 deletions src/CoreBundle/Entity/Block.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,118 @@
<?php

declare(strict_types=1);

/* For licensing terms, see /license.txt */

namespace Chamilo\CoreBundle\Entity;

use Chamilo\CoreBundle\Traits\UserTrait;
use Doctrine\ORM\Mapping as ORM;

/**
* Block entity.
*/
#[ORM\Table(name: 'block')]
#[ORM\Entity]
class Block
{
use UserTrait;

#[ORM\Column(name: 'id', type: 'integer')]
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'IDENTITY')]
protected ?int $id = null;

#[ORM\Column(name: 'title', type: 'string', length: 255, nullable: true)]
protected ?string $title = null;

#[ORM\Column(name: 'description', type: 'text', nullable: true)]
protected ?string $description = null;

#[ORM\Column(name: 'path', type: 'string', length: 190, nullable: false)]
protected string $path;

#[ORM\Column(name: 'controller', type: 'string', length: 100, nullable: false)]
protected string $controller;

#[ORM\Column(name: 'active', type: 'boolean', nullable: false)]
protected bool $active;

#[ORM\OneToOne(inversedBy: 'block', targetEntity: User::class)]
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
protected User $user;

/**
* Get id.
*/
public function getId(): ?int
{
return $this->id;
}

public function getTitle(): ?string
{
return $this->title;
}

public function setTitle(?string $title): self
{
$this->title = $title;
return $this;
}

public function getDescription(): ?string
{
return $this->description;
}

public function setDescription(?string $description): self
{
$this->description = $description;
return $this;
}

public function getPath(): string
{
return $this->path;
}

public function setPath(string $path): self
{
$this->path = $path;
return $this;
}

public function getController(): string
{
return $this->controller;
}

public function setController(string $controller): self
{
$this->controller = $controller;
return $this;
}

public function isActive(): bool
{
return $this->active;
}

public function setActive(bool $active): self
{
$this->active = $active;
return $this;
}

public function getUser(): User
{
return $this->user;
}

public function setUser(User $user): self
{
$this->user = $user;
return $this;
}
}
99 changes: 99 additions & 0 deletions src/CoreBundle/Entity/JustificationDocument.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,99 @@
<?php

declare(strict_types=1);

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Add a single space around assignment operators


/* For licensing terms, see /license.txt */

namespace Chamilo\CoreBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

#[ORM\Table(name: 'justification_document')]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

class JustificationDocument

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You must use "/**" style comments for a class comment

{
#[ORM\Id]

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Perl-style comments are not allowed. Use "// Comment." or "/* comment */" instead.

#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer')]
private ?int $id = null;

#[ORM\Column(type: 'text', nullable: true)]
private ?string $code = null;

#[ORM\Column(type: 'text', nullable: true)]
private ?string $name = null;

#[ORM\Column(type: 'integer', nullable: true)]
private ?int $validityDuration = null;

#[ORM\Column(type: 'text', nullable: true)]
private ?string $comment = null;

#[ORM\Column(type: 'integer', nullable: true)]
private ?int $dateManualOn = null;

public function getId(): ?int
{
return $this->id;
}

public function getCode(): ?string
{
return $this->code;
}

public function setCode(?string $code): self
{
$this->code = $code;

return $this;
}

public function getName(): ?string
{
return $this->name;
}

public function setName(?string $name): self
{
$this->name = $name;

return $this;
}

public function getValidityDuration(): ?int
{
return $this->validityDuration;
}

public function setValidityDuration(?int $validityDuration): self
{
$this->validityDuration = $validityDuration;

return $this;
}

public function getComment(): ?string
{
return $this->comment;
}

public function setComment(?string $comment): self
{
$this->comment = $comment;

return $this;
}

public function getDateManualOn(): ?int
{
return $this->dateManualOn;
}

public function setDateManualOn(?int $dateManualOn): self
{
$this->dateManualOn = $dateManualOn;

return $this;
}
}
86 changes: 86 additions & 0 deletions src/CoreBundle/Entity/JustificationDocumentRelUsers.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,86 @@
<?php

declare(strict_types=1);

/* For licensing terms, see /license.txt */

namespace Chamilo\CoreBundle\Entity;

use Doctrine\ORM\Mapping as ORM;

#[ORM\Entity]
#[ORM\Table(name: 'justification_document_rel_users')]
class JustificationDocumentRelUsers
{
#[ORM\Id]
#[ORM\GeneratedValue(strategy: 'AUTO')]
#[ORM\Column(type: 'integer')]
private ?int $id = null;

#[ORM\ManyToOne(targetEntity: JustificationDocument::class)]
#[ORM\JoinColumn(name: 'justification_document_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
private JustificationDocument $justificationDocument;

#[ORM\Column(type: 'string', length: 255, nullable: true)]
private ?string $filePath = null;

#[ORM\ManyToOne(targetEntity: User::class)]
#[ORM\JoinColumn(name: 'user_id', referencedColumnName: 'id', onDelete: 'CASCADE')]
private ?User $user = null;

#[ORM\Column(type: 'date', nullable: true)]
private ?\DateTime $dateValidity = null;

public function getId(): ?int
{
return $this->id;
}

public function getJustificationDocument(): JustificationDocument
{
return $this->justificationDocument;
}

public function setJustificationDocument(JustificationDocument $justificationDocument): self
{
$this->justificationDocument = $justificationDocument;

return $this;
}

public function getFilePath(): ?string
{
return $this->filePath;
}

public function setFilePath(?string $filePath): self
{
$this->filePath = $filePath;

return $this;
}

public function getUser(): ?User
{
return $this->user;
}

public function setUser(?User $user): self
{
$this->user = $user;

return $this;
}

public function getDateValidity(): ?\DateTime
{
return $this->dateValidity;
}

public function setDateValidity(?\DateTime $dateValidity): self
{
$this->dateValidity = $dateValidity;

return $this;
}
}
17 changes: 0 additions & 17 deletions src/CoreBundle/Migrations/Schema/V200/Version20170524110000.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,27 +39,10 @@ public function up(Schema $schema): void
'ALTER TABLE track_e_hotpotatoes CHANGE exe_name title VARCHAR(255) NOT NULL'
);
}

if ($schema->hasTable('lti_external_tool')) {
$this->addSql(
'ALTER TABLE lti_external_tool CHANGE name title VARCHAR(255) NOT NULL'
);
}

if ($schema->hasTable('plugin_ims_lti_tool')) {
$this->addSql(
'ALTER TABLE plugin_ims_lti_tool CHANGE name title VARCHAR(255) NOT NULL'
);
}
}

public function down(Schema $schema): void
{
$table = $schema->getTable('lti_external_tool');
if ($table->hasColumn('title')) {
$this->addSql('ALTER TABLE lti_external_tool CHANGE title name VARCHAR(255) NOT NULL');
}

$table = $schema->getTable('track_e_hotpotatoes');
if ($table->hasColumn('title')) {
$this->addSql('ALTER TABLE track_e_hotpotatoes CHANGE title exe_name VARCHAR(255) NOT NULL');
Expand Down
Loading