before recipes:update
This commit is contained in:
.eslintrccomposer.jsoncomposer.lockpackage.jsonrector.php
assets
images
js
App.vue
components
AppLink.vueHandleLogout.vueLoginForm.vueNotFound.vueTheFooter.vueTheNavbar.vueTheSidebar.vuefooter.vuelogin.vuenot-found.vue
index.jspages
projects
quotes
sidebar.vuetabs
users
router
styles
src
Controller
Entity
Repository
Security
templates
webpack.config.jsyarn.lock@@ -10,27 +10,27 @@ use Doctrine\ORM\Mapping as ORM;
|
||||
|
||||
#[ORM\Entity(repositoryClass: ProjectsRepository::class)]
|
||||
#[ApiResource]
|
||||
class Projects
|
||||
class Projects implements \Stringable
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
#[ORM\Column(type: 'integer')]
|
||||
private ?int $id;
|
||||
private ?int $id = null;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private ?string $name;
|
||||
private ?string $name = null;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private ?string $description;
|
||||
private ?string $description = null;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255)]
|
||||
private ?string $url;
|
||||
private ?string $url = null;
|
||||
|
||||
#[ORM\Column(type: 'datetime_immutable')]
|
||||
private ?\DateTimeImmutable $createdAt;
|
||||
private ?\DateTimeImmutable $createdAt = null;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
private ?string $teaserImage;
|
||||
private ?string $teaserImage = null;
|
||||
|
||||
#[ORM\ManyToMany(targetEntity: User::class, inversedBy: 'projects')]
|
||||
private $developer;
|
||||
@@ -43,9 +43,9 @@ class Projects
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function __toString()
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->name;
|
||||
return (string) $this->name;
|
||||
}
|
||||
|
||||
public function getId(): ?int
|
||||
|
@@ -15,16 +15,17 @@ use Symfony\Component\Security\Core\User\UserInterface;
|
||||
|
||||
/**
|
||||
* => ["security" => "is_granted('ROLE_ADMIN') or object.owner == user"]
|
||||
attributes : ['security' => 'is_granted("ROLE_USER")']
|
||||
|
||||
*/
|
||||
#[ORM\Entity(repositoryClass: UserRepository::class), ORM\HasLifecycleCallbacks]
|
||||
#[ApiResource(
|
||||
collectionOperations: ['get', 'post'],
|
||||
itemOperations : ['get'],
|
||||
attributes : ['security' => 'is_granted("ROLE_USER")']
|
||||
)]
|
||||
#[ApiFilter(filterClass: SearchFilter::class, properties: ['username' => 'exact'])]
|
||||
|
||||
class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
class User implements UserInterface, PasswordAuthenticatedUserInterface, \Stringable
|
||||
{
|
||||
#[ORM\Id]
|
||||
#[ORM\GeneratedValue]
|
||||
@@ -55,7 +56,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
private $projects;
|
||||
|
||||
#[ORM\Column(type: 'string', length: 255, nullable: true)]
|
||||
private $avatar;
|
||||
private string $avatar;
|
||||
|
||||
#[ORM\OneToMany(mappedBy: 'owner', targetEntity: Pages::class)]
|
||||
private $pages;
|
||||
@@ -75,7 +76,7 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
/**
|
||||
* @return string|null
|
||||
*/
|
||||
public function __toString()
|
||||
public function __toString(): string
|
||||
{
|
||||
return $this->username;
|
||||
}
|
||||
@@ -244,9 +245,9 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
|
||||
public function addPage(Pages $page): self
|
||||
{
|
||||
if (!$this->pages->contains($page)) {
|
||||
if (!$this->pages->contains(element: $page)) {
|
||||
$this->pages[] = $page;
|
||||
$page->setOwner($this);
|
||||
$page->setOwner(owner: $this);
|
||||
}
|
||||
|
||||
return $this;
|
||||
@@ -254,10 +255,10 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
|
||||
public function removePage(Pages $page): self
|
||||
{
|
||||
if ($this->pages->removeElement($page)) {
|
||||
if ($this->pages->removeElement(element: $page)) {
|
||||
// set the owning side to null (unless already changed)
|
||||
if ($page->getOwner() === $this) {
|
||||
$page->setOwner(null);
|
||||
$page->setOwner(owner: null);
|
||||
}
|
||||
}
|
||||
|
||||
@@ -287,8 +288,11 @@ class User implements UserInterface, PasswordAuthenticatedUserInterface
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
public function getAvatarUri()
|
||||
|
||||
/**
|
||||
* @return string
|
||||
*/
|
||||
public function getAvatarUri()
|
||||
{
|
||||
return 'avatar';
|
||||
}
|
||||
|
Reference in New Issue
Block a user