Skip to content

Commit

Permalink
fix: aligned types with database field
Browse files Browse the repository at this point in the history
  • Loading branch information
nieck committed Nov 21, 2024
1 parent 0b3f672 commit f9413fe
Show file tree
Hide file tree
Showing 15 changed files with 407 additions and 1,115 deletions.
36 changes: 6 additions & 30 deletions Entity/Content.php
Original file line number Diff line number Diff line change
Expand Up @@ -11,37 +11,20 @@ class Content
#[ORM\Id]
#[ORM\Column(type: "integer")]
#[ORM\GeneratedValue(strategy:"AUTO")]
/**
* @var int
*/
private ?int $id;
private ?int $id = null;

#[ORM\ManyToOne(targetEntity: Library::class)]
#[ORM\JoinColumn(name: "library_id", referencedColumnName: "id", onDelete: "CASCADE")]
/**
* @var Library
* @ORM\ManyToOne(targetEntity="\Emmedy\H5PBundle\Entity\Library")
*/
private ?Library $library;
private ?Library $library = null;

/**
* @var string|null
*/
#[ORM\Column(name: "parameters", type: "text", nullable: true)]
private ?string $parameters;
private ?string $parameters = null;

#[ORM\Column(name: "filtered_parameters", type: "text", nullable: true)]
/**
* @var string|null
*/
private ?string $filteredParameters;
private ?string $filteredParameters = null;

#[ORM\Column(name: "disabled_features", type: "integer", nullable: true)]

/**
* @var int|null
*/
private ?int $disabledFeatures;
private ?int $disabledFeatures = null;

public function __clone(): void
{
Expand All @@ -55,14 +38,7 @@ public function getId(): int
{
return $this->id;
}
/**
* @param int $id
*/
public function setId(int $id): self
{
$this->id = $id;
return $this;
}

/**
* @return Library
*/
Expand Down
85 changes: 21 additions & 64 deletions Entity/ContentLibraries.php
Original file line number Diff line number Diff line change
Expand Up @@ -12,116 +12,73 @@ class ContentLibraries
#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Content::class)]
#[ORM\JoinColumn(name: "content_id", referencedColumnName: "id", onDelete: "CASCADE")]
/**
* @var Content|null
*/
private ?Content $content;
private Content $content;

#[ORM\Id]
#[ORM\ManyToOne(targetEntity: Library::class, inversedBy: "contentLibraries")]
#[ORM\JoinColumn(name: "library_id", referencedColumnName: "id", onDelete: "CASCADE")]

/**
* @var Library
*/
private ?Library $library;
private Library $library;

#[ORM\Id()]
#[ORM\Column(name: "dependency_type", type: "string", length: 31)]

/**
* @var null|string
*/
private null|string $dependencyType;
private string $dependencyType;

#[ORM\Column(name: "drop_css", type: "boolean", length: 1)]
/**
* @var bool|null
*/
private ?bool $dropCss;
/**
* @var int|null
*/
private bool $dropCss;

#[ORM\Column(name: "weight", type: "integer")]
private ?int $weight;
private int $weight;

/**
* @return Content|null
*/
public function getContent(): ?Content
public function getContent(): Content
{
return $this->content;
}
/**
* @param Content|null $content
* @return self
*/
public function setContent(?Content $content): self

public function setContent(Content $content): self
{
$this->content = $content;
return $this;
}

/**
* @return Library
*/
public function getLibrary(): Library
{
return $this->library;
}

/**
* @param Library $library
* @return self
*/
public function setLibrary($library): self
public function setLibrary(Library $library): self
{
$this->library = $library;
return $this;
}

/**
* @return string|null
*/
public function getDependencyType(): ?string
public function getDependencyType(): string
{
return $this->dependencyType;
}
/**
* @param null|string $dependencyType
* @return self
*/
public function setDependencyType(?string $dependencyType): self

public function setDependencyType(string $dependencyType): self
{
$this->dependencyType = $dependencyType;
return $this;
}
/**
* @return bool
*/
public function isDropCss(): ?bool

public function isDropCss(): bool
{
return $this->dropCss;
}
/**
* @param bool $dropCss
*/
public function setDropCss($dropCss): self

public function setDropCss(bool $dropCss): self
{
$this->dropCss = $dropCss;
return $this;
}
/**
* @return int
*/
public function getWeight(): ?int

public function getWeight(): int
{
return $this->weight;
}
/**
* @param int $weight
*/
public function setWeight($weight): self

public function setWeight(int $weight): self
{
$this->weight = $weight;
return $this;
Expand Down
6 changes: 0 additions & 6 deletions Entity/ContentRepository.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,12 +6,6 @@
use Doctrine\Bundle\DoctrineBundle\Repository\ServiceEntityRepository;
use Doctrine\Persistence\ManagerRegistry;

/**
* ContentRepository
*
* This class was generated by the PhpStorm "Php Annotations" Plugin. Add your own custom
* repository methods below.
*/
class ContentRepository extends ServiceEntityRepository
{
public function __construct(ManagerRegistry $registry)
Expand Down
Loading

0 comments on commit f9413fe

Please sign in to comment.