Fix config
This commit is contained in:
@@ -11,6 +11,7 @@
|
|||||||
"ext-curl": "*",
|
"ext-curl": "*",
|
||||||
"ext-iconv": "*",
|
"ext-iconv": "*",
|
||||||
"api-platform/core": "^3.2",
|
"api-platform/core": "^3.2",
|
||||||
|
"doctrine/dbal": "^3",
|
||||||
"doctrine/doctrine-bundle": "^2.11",
|
"doctrine/doctrine-bundle": "^2.11",
|
||||||
"doctrine/doctrine-migrations-bundle": "^3.3",
|
"doctrine/doctrine-migrations-bundle": "^3.3",
|
||||||
"doctrine/orm": "^2.17",
|
"doctrine/orm": "^2.17",
|
||||||
|
|||||||
2
composer.lock
generated
2
composer.lock
generated
@@ -4,7 +4,7 @@
|
|||||||
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
|
||||||
"This file is @generated automatically"
|
"This file is @generated automatically"
|
||||||
],
|
],
|
||||||
"content-hash": "46418bba7f81de1bb030e3321a5fb4c9",
|
"content-hash": "7f30c3ed2e16470ab82ad4fd0ca8b987",
|
||||||
"packages": [
|
"packages": [
|
||||||
{
|
{
|
||||||
"name": "api-platform/core",
|
"name": "api-platform/core",
|
||||||
|
|||||||
@@ -26,10 +26,6 @@ services:
|
|||||||
App\EventListener\ExceptionListener:
|
App\EventListener\ExceptionListener:
|
||||||
tags:
|
tags:
|
||||||
- { name: kernel.event_listener, event: kernel.exception, method: onKernelException }
|
- { name: kernel.event_listener, event: kernel.exception, method: onKernelException }
|
||||||
|
|
||||||
App\Service\DataLakeClient:
|
|
||||||
arguments:
|
|
||||||
$baseUrl: '%env(DATA_LAKE_BASE_URL)%'
|
|
||||||
|
|
||||||
GuzzleHttp\Client:
|
GuzzleHttp\Client:
|
||||||
class: GuzzleHttp\Client
|
class: GuzzleHttp\Client
|
||||||
|
|||||||
@@ -3,12 +3,6 @@
|
|||||||
namespace App\DataFixtures;
|
namespace App\DataFixtures;
|
||||||
|
|
||||||
use App\Factory\ApiTokenFactory;
|
use App\Factory\ApiTokenFactory;
|
||||||
use App\Factory\CommentFactory;
|
|
||||||
use App\Factory\CompanyFactory;
|
|
||||||
use App\Factory\DocumentFactory;
|
|
||||||
use App\Factory\FolderFactory;
|
|
||||||
use App\Factory\ProjectDocumentFactory;
|
|
||||||
use App\Factory\ProjectFactory;
|
|
||||||
use App\Factory\UserFactory;
|
use App\Factory\UserFactory;
|
||||||
use Doctrine\Bundle\FixturesBundle\Fixture;
|
use Doctrine\Bundle\FixturesBundle\Fixture;
|
||||||
use Doctrine\Persistence\ObjectManager;
|
use Doctrine\Persistence\ObjectManager;
|
||||||
@@ -17,70 +11,6 @@ class AppFixtures extends Fixture
|
|||||||
{
|
{
|
||||||
public function load(ObjectManager $manager): void
|
public function load(ObjectManager $manager): void
|
||||||
{
|
{
|
||||||
CompanyFactory::createMany(5);
|
|
||||||
UserFactory::createMany(20, function () {
|
|
||||||
return [
|
|
||||||
'company' => CompanyFactory::random()
|
|
||||||
];
|
|
||||||
});
|
|
||||||
ApiTokenFactory::createMany(60, function () {
|
|
||||||
return [
|
|
||||||
'ownedBy' => UserFactory::random()
|
|
||||||
];
|
|
||||||
});
|
|
||||||
$projects = ProjectFactory::createMany(100, function () {
|
|
||||||
return [
|
|
||||||
'ownedBy' => UserFactory::random()
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
$documents = DocumentFactory::createMany(100);
|
|
||||||
|
|
||||||
foreach ($documents as $document) {
|
|
||||||
ProjectDocumentFactory::createMany(3, function () use ($document) {
|
|
||||||
return [
|
|
||||||
'document' => $document,
|
|
||||||
'project' => ProjectFactory::random()
|
|
||||||
];
|
|
||||||
});
|
|
||||||
|
|
||||||
CommentFactory::createMany(1, function () use ($document) {
|
|
||||||
return [
|
|
||||||
'projectDocument' => ProjectDocumentFactory::random(),
|
|
||||||
'postedBy' => UserFactory::random()
|
|
||||||
];
|
|
||||||
});
|
|
||||||
}
|
|
||||||
|
|
||||||
foreach ($projects as $project) {
|
|
||||||
$projectFolder = FolderFactory::createOne([
|
|
||||||
'label' => 'Root Folder Project ' . $project->getId(),
|
|
||||||
'slug' => 'root-folder-project-' . $project->getId(),
|
|
||||||
'project' => $project,
|
|
||||||
'createdBy' => $project->getOwnedBy()
|
|
||||||
]);
|
|
||||||
$child = FolderFactory::createOne([
|
|
||||||
'label' => 'Subfolder - Parent Folder: ' . $projectFolder->getId(),
|
|
||||||
'slug' => 'subfolder-parent-folder-' . $projectFolder->getId(),
|
|
||||||
'createdBy' => $project->getOwnedBy()
|
|
||||||
]);
|
|
||||||
$grandChild = FolderFactory::createOne([
|
|
||||||
'label' => 'Subfolder - Parent Folder: ' . $child->getId(),
|
|
||||||
'slug' => 'subfolder-parent-folder-' . $child->getId(),
|
|
||||||
'createdBy' => $project->getOwnedBy()
|
|
||||||
]);
|
|
||||||
|
|
||||||
$grandChild->addDocument(DocumentFactory::createOne()->object());
|
|
||||||
$grandChild->addDocument(DocumentFactory::createOne()->object());
|
|
||||||
$grandChild->addDocument(DocumentFactory::createOne()->object());
|
|
||||||
|
|
||||||
$child->addChild(
|
|
||||||
$grandChild->object()
|
|
||||||
);
|
|
||||||
|
|
||||||
$projectFolder->addChild(
|
|
||||||
$child->object()
|
|
||||||
);
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|||||||
@@ -75,32 +75,14 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||||||
|
|
||||||
private ?array $accessTokenScopes = null;
|
private ?array $accessTokenScopes = null;
|
||||||
|
|
||||||
#[ORM\ManyToOne(inversedBy: 'employees')]
|
|
||||||
#[ORM\JoinColumn(nullable: true, onDelete: 'SET NULL')]
|
|
||||||
#[Groups(['user:read'])]
|
|
||||||
private ?Company $company = null;
|
|
||||||
|
|
||||||
#[Groups(['user:write'])]
|
#[Groups(['user:write'])]
|
||||||
#[SerializedName('password')]
|
#[SerializedName('password')]
|
||||||
#[Assert\NotBlank(groups: ['postValidation'])]
|
#[Assert\NotBlank(groups: ['postValidation'])]
|
||||||
private ?string $plainPassword = null;
|
private ?string $plainPassword = null;
|
||||||
|
|
||||||
#[ORM\OneToMany(mappedBy: 'ownedBy', targetEntity: Project::class)]
|
|
||||||
#[Groups(['user:read'])]
|
|
||||||
private Collection $projects;
|
|
||||||
|
|
||||||
#[ORM\OneToMany(mappedBy: 'postedBy', targetEntity: Comment::class)]
|
|
||||||
private Collection $comments;
|
|
||||||
|
|
||||||
#[ORM\OneToMany(mappedBy: 'createdBy', targetEntity: Folder::class)]
|
|
||||||
private Collection $folders;
|
|
||||||
|
|
||||||
public function __construct()
|
public function __construct()
|
||||||
{
|
{
|
||||||
$this->apiTokens = new ArrayCollection();
|
$this->apiTokens = new ArrayCollection();
|
||||||
$this->projects = new ArrayCollection();
|
|
||||||
$this->comments = new ArrayCollection();
|
|
||||||
$this->folders = new ArrayCollection();
|
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getId(): ?int
|
public function getId(): ?int
|
||||||
@@ -250,18 +232,6 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||||||
$this->accessTokenScopes = $scopes;
|
$this->accessTokenScopes = $scopes;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function getCompany(): ?Company
|
|
||||||
{
|
|
||||||
return $this->company;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function setCompany(?Company $company): static
|
|
||||||
{
|
|
||||||
$this->company = $company;
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function getPlainPassword(): ?string
|
public function getPlainPassword(): ?string
|
||||||
{
|
{
|
||||||
return $this->plainPassword;
|
return $this->plainPassword;
|
||||||
@@ -271,94 +241,4 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
|||||||
{
|
{
|
||||||
$this->plainPassword = $plainPassword;
|
$this->plainPassword = $plainPassword;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Collection<int, Project>
|
|
||||||
*/
|
|
||||||
public function getProjects(): Collection
|
|
||||||
{
|
|
||||||
return $this->projects;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addProject(Project $project): static
|
|
||||||
{
|
|
||||||
if (!$this->projects->contains($project)) {
|
|
||||||
$this->projects->add($project);
|
|
||||||
$project->setOwnedBy($this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function removeProject(Project $project): static
|
|
||||||
{
|
|
||||||
if ($this->projects->removeElement($project)) {
|
|
||||||
// set the owning side to null (unless already changed)
|
|
||||||
if ($project->getOwnedBy() === $this) {
|
|
||||||
$project->setOwnedBy(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Collection<int, Comment>
|
|
||||||
*/
|
|
||||||
public function getComments(): Collection
|
|
||||||
{
|
|
||||||
return $this->comments;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addComment(Comment $comment): static
|
|
||||||
{
|
|
||||||
if (!$this->comments->contains($comment)) {
|
|
||||||
$this->comments->add($comment);
|
|
||||||
$comment->setPostedBy($this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function removeComment(Comment $comment): static
|
|
||||||
{
|
|
||||||
if ($this->comments->removeElement($comment)) {
|
|
||||||
// set the owning side to null (unless already changed)
|
|
||||||
if ($comment->getPostedBy() === $this) {
|
|
||||||
$comment->setPostedBy(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
|
||||||
* @return Collection<int, Folder>
|
|
||||||
*/
|
|
||||||
public function getFolders(): Collection
|
|
||||||
{
|
|
||||||
return $this->folders;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function addFolder(Folder $folder): static
|
|
||||||
{
|
|
||||||
if (!$this->folders->contains($folder)) {
|
|
||||||
$this->folders->add($folder);
|
|
||||||
$folder->setCreatedBy($this);
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
|
|
||||||
public function removeFolder(Folder $folder): static
|
|
||||||
{
|
|
||||||
if ($this->folders->removeElement($folder)) {
|
|
||||||
// set the owning side to null (unless already changed)
|
|
||||||
if ($folder->getCreatedBy() === $this) {
|
|
||||||
$folder->setCreatedBy(null);
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
return $this;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|||||||
Reference in New Issue
Block a user