Skip to content

Commit

Permalink
feat(Attributes): Migration to attributes
Browse files Browse the repository at this point in the history
  • Loading branch information
ambroisemaupate committed Oct 11, 2022
1 parent d4b9ee9 commit 21a28c8
Show file tree
Hide file tree
Showing 15 changed files with 1,723 additions and 3 deletions.
2 changes: 0 additions & 2 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -165,8 +165,6 @@ fabric.properties
/report.txt
/composer.lock
/symfony.lock
/src/GeneratedEntity/*.php
/src/GeneratedEntity/Repository/*.php

###> lexik/jwt-authentication-bundle ###
/config/jwt/*.pem
Expand Down
2 changes: 1 addition & 1 deletion composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
"doctrine/doctrine-migrations-bundle": "^3.1",
"doctrine/migrations": "^3.1.1",
"doctrine/orm": "^2.12.2",
"gedmo/doctrine-extensions": "^2.4 || ^3.0.0",
"gedmo/doctrine-extensions": "^3.9.0",
"inlinestyle/inlinestyle": "~1.2.7",
"james-heinrich/getid3": "^1.9",
"jms/serializer": "^3.1.1",
Expand Down
2 changes: 2 additions & 0 deletions rector.php
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
use Rector\Config\RectorConfig;
use Rector\Doctrine\Set\DoctrineSetList;
use Rector\Set\ValueObject\LevelSetList;
use Rector\Symfony\Set\JMSSetList;
use Rector\Symfony\Set\SymfonySetList;

return static function (RectorConfig $rectorConfig): void {
Expand All @@ -20,6 +21,7 @@
$rectorConfig->sets([
// LevelSetList::UP_TO_PHP_80,
DoctrineSetList::ANNOTATIONS_TO_ATTRIBUTES,
JMSSetList::ANNOTATIONS_TO_ATTRIBUTES,
SymfonySetList::ANNOTATIONS_TO_ATTRIBUTES,
]);
};
191 changes: 191 additions & 0 deletions src/GeneratedEntity/NSArticle.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,191 @@
<?php

declare(strict_types=1);

/*
* THIS IS A GENERATED FILE, DO NOT EDIT IT
* IT WILL BE RECREATED AT EACH NODE-TYPE UPDATE
*/
namespace App\GeneratedEntity;

use JMS\Serializer\Annotation as Serializer;
use Symfony\Component\Serializer\Annotation as SymfonySerializer;
use Gedmo\Mapping\Annotation as Gedmo;
use Doctrine\ORM\Mapping as ORM;
use ApiPlatform\Core\Annotation\ApiFilter;
use ApiPlatform\Core\Bridge\Doctrine\Orm\Filter as OrmFilter;
use ApiPlatform\Core\Serializer\Filter\PropertyFilter;

/**
* DO NOT EDIT
* Generated custom node-source type by Roadiz.
*/
#[
Gedmo\Loggable(logEntryClass: \RZ\Roadiz\CoreBundle\Entity\UserLogEntry::class),
ORM\Entity(repositoryClass: \App\GeneratedEntity\Repository\NSArticleRepository::class),
ORM\Table(name: "ns_article"),
ApiFilter(PropertyFilter::class)
]
class NSArticle extends \RZ\Roadiz\CoreBundle\Entity\NodesSources
{
/**
* Your content.
*/
#[
SymfonySerializer\SerializedName(serializedName: "content"),
SymfonySerializer\Groups(["nodes_sources", "nodes_sources_default"]),
SymfonySerializer\MaxDepth(2),
Gedmo\Versioned,
ORM\Column(type: "text", nullable: true, name: "content"),
Serializer\Groups(["nodes_sources", "nodes_sources_default"]),
Serializer\MaxDepth(2),
Serializer\Type("string")
]
private ?string $content = null;

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

/**
* @param string|null $content
*
* @return $this
*/
public function setContent($content)
{
$this->content = null !== $content ?
(string) $content :
null;

return $this;
}


/**
* Secret realm_b.
*/
#[
SymfonySerializer\SerializedName(serializedName: "realmBSecret"),
SymfonySerializer\Groups(["realm_b"]),
SymfonySerializer\MaxDepth(2),
Gedmo\Versioned,
ORM\Column(
type: "string",
nullable: true,
name: "realm_b_secret",
length: 250
),
Serializer\Groups(["realm_b"]),
Serializer\MaxDepth(2),
Serializer\Type("string")
]
private ?string $realmBSecret = null;

/**
* @return string|null
*/
public function getRealmBSecret(): ?string
{
return $this->realmBSecret;
}

/**
* @param string|null $realmBSecret
*
* @return $this
*/
public function setRealmBSecret($realmBSecret)
{
$this->realmBSecret = null !== $realmBSecret ?
(string) $realmBSecret :
null;

return $this;
}


/**
* Secret realm_a.
*/
#[
SymfonySerializer\SerializedName(serializedName: "realmASecret"),
SymfonySerializer\Groups(["realm_a"]),
SymfonySerializer\MaxDepth(2),
Gedmo\Versioned,
ORM\Column(
type: "string",
nullable: true,
name: "realm_a_secret",
length: 250
),
Serializer\Groups(["realm_a"]),
Serializer\MaxDepth(2),
Serializer\Type("string")
]
private ?string $realmASecret = null;

/**
* @return string|null
*/
public function getRealmASecret(): ?string
{
return $this->realmASecret;
}

/**
* @param string|null $realmASecret
*
* @return $this
*/
public function setRealmASecret($realmASecret)
{
$this->realmASecret = null !== $realmASecret ?
(string) $realmASecret :
null;

return $this;
}


#[
Serializer\VirtualProperty,
Serializer\Groups(["nodes_sources", "nodes_sources_default"]),
Serializer\SerializedName("@type"),
SymfonySerializer\Groups(["nodes_sources", "nodes_sources_default"]),
SymfonySerializer\SerializedName(serializedName: "@type")
]
public function getNodeTypeName(): string
{
return 'Article';
}

/**
* $this->nodeType->isReachable() proxy.
*
* @return bool Does this nodeSource is reachable over network?
*/
public function isReachable(): bool
{
return true;
}

/**
* $this->nodeType->isPublishable() proxy.
*
* @return bool Does this nodeSource is publishable with date and time?
*/
public function isPublishable(): bool
{
return true;
}

public function __toString()
{
return '[NSArticle] ' . parent::__toString();
}
}
Loading

0 comments on commit 21a28c8

Please sign in to comment.