Skip to content

Commit

Permalink
bug Sylius#881 Revert "[Maintenance] Annotation changed to PHP Attrib…
Browse files Browse the repository at this point in the history
…utes in the Entity classes" (Zales0123)

This PR was merged into the 1.12 branch.

Discussion
----------

Reverts Sylius#865

It was probably merged too fast, we should make a smoother transition path with the usage of both attributes and annotations at the beginning 🖖 Reverting it to release 1.12.2 and introducing attributes usage properly in the nearest future.

Discussion on Sylius Devs Slack that lead to this revert: https://sylius-devs.slack.com/archives/C9GQMG316/p1669720969325669

Commits
-------

1bdd549 Revert "[Maintenance] Annotation changed to PHP Attributes in the Entity classes"
  • Loading branch information
Zales0123 authored Nov 29, 2022
2 parents 2f47d25 + 1bdd549 commit 09b01b6
Show file tree
Hide file tree
Showing 59 changed files with 233 additions and 117 deletions.
2 changes: 1 addition & 1 deletion config/packages/doctrine.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ doctrine:
mappings:
App:
is_bundle: false
type: attribute
type: annotation
dir: '%kernel.project_dir%/src/Entity'
prefix: 'App\Entity'
alias: App
6 changes: 4 additions & 2 deletions src/Entity/Addressing/Address.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\Address as BaseAddress;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_address')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_address")
*/
class Address extends BaseAddress
{
}
6 changes: 4 additions & 2 deletions src/Entity/Addressing/Country.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Addressing\Model\Country as BaseCountry;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_country')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_country")
*/
class Country extends BaseCountry
{
}
6 changes: 4 additions & 2 deletions src/Entity/Addressing/Province.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Addressing\Model\Province as BaseProvince;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_province')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_province")
*/
class Province extends BaseProvince
{
}
6 changes: 4 additions & 2 deletions src/Entity/Addressing/Zone.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Addressing\Model\Zone as BaseZone;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_zone')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_zone")
*/
class Zone extends BaseZone
{
}
6 changes: 4 additions & 2 deletions src/Entity/Addressing/ZoneMember.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Addressing\Model\ZoneMember as BaseZoneMember;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_zone_member')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_zone_member")
*/
class ZoneMember extends BaseZoneMember
{
}
6 changes: 4 additions & 2 deletions src/Entity/Channel/Channel.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\Channel as BaseChannel;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_channel')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_channel")
*/
class Channel extends BaseChannel
{
}
6 changes: 4 additions & 2 deletions src/Entity/Channel/ChannelPricing.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\ChannelPricing as BaseChannelPricing;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_channel_pricing')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_channel_pricing")
*/
class ChannelPricing extends BaseChannelPricing
{
}
6 changes: 4 additions & 2 deletions src/Entity/Currency/Currency.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Currency\Model\Currency as BaseCurrency;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_currency')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_currency")
*/
class Currency extends BaseCurrency
{
}
6 changes: 4 additions & 2 deletions src/Entity/Currency/ExchangeRate.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Currency\Model\ExchangeRate as BaseExchangeRate;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_exchange_rate')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_exchange_rate")
*/
class ExchangeRate extends BaseExchangeRate
{
}
6 changes: 4 additions & 2 deletions src/Entity/Customer/Customer.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\Customer as BaseCustomer;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_customer')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_customer")
*/
class Customer extends BaseCustomer
{
}
6 changes: 4 additions & 2 deletions src/Entity/Customer/CustomerGroup.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Customer\Model\CustomerGroup as BaseCustomerGroup;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_customer_group')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_customer_group")
*/
class CustomerGroup extends BaseCustomerGroup
{
}
6 changes: 4 additions & 2 deletions src/Entity/Locale/Locale.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Locale\Model\Locale as BaseLocale;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_locale')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_locale")
*/
class Locale extends BaseLocale
{
}
6 changes: 4 additions & 2 deletions src/Entity/Order/Adjustment.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\Adjustment as BaseAdjustment;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_adjustment')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_adjustment")
*/
class Adjustment extends BaseAdjustment
{
}
6 changes: 4 additions & 2 deletions src/Entity/Order/Order.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\Order as BaseOrder;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_order')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_order")
*/
class Order extends BaseOrder
{
}
6 changes: 4 additions & 2 deletions src/Entity/Order/OrderItem.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\OrderItem as BaseOrderItem;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_order_item')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_order_item")
*/
class OrderItem extends BaseOrderItem
{
}
6 changes: 4 additions & 2 deletions src/Entity/Order/OrderItemUnit.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\OrderItemUnit as BaseOrderItemUnit;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_order_item_unit')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_order_item_unit")
*/
class OrderItemUnit extends BaseOrderItemUnit
{
}
6 changes: 4 additions & 2 deletions src/Entity/Order/OrderSequence.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\OrderSequence as BaseOrderSequence;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_order_sequence')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_order_sequence")
*/
class OrderSequence extends BaseOrderSequence
{
}
6 changes: 4 additions & 2 deletions src/Entity/Payment/GatewayConfig.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Bundle\PayumBundle\Model\GatewayConfig as BaseGatewayConfig;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_gateway_config')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_gateway_config")
*/
class GatewayConfig extends BaseGatewayConfig
{
}
6 changes: 4 additions & 2 deletions src/Entity/Payment/Payment.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\Payment as BasePayment;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_payment')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_payment")
*/
class Payment extends BasePayment
{
}
6 changes: 4 additions & 2 deletions src/Entity/Payment/PaymentMethod.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
use Sylius\Component\Core\Model\PaymentMethod as BasePaymentMethod;
use Sylius\Component\Payment\Model\PaymentMethodTranslationInterface;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_payment_method')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_payment_method")
*/
class PaymentMethod extends BasePaymentMethod
{
protected function createTranslation(): PaymentMethodTranslationInterface
Expand Down
6 changes: 4 additions & 2 deletions src/Entity/Payment/PaymentMethodTranslation.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Payment\Model\PaymentMethodTranslation as BasePaymentMethodTranslation;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_payment_method_translation')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_payment_method_translation")
*/
class PaymentMethodTranslation extends BasePaymentMethodTranslation
{
}
6 changes: 4 additions & 2 deletions src/Entity/Payment/PaymentSecurityToken.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Bundle\PayumBundle\Model\PaymentSecurityToken as BasePaymentSecurityToken;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_payment_security_token')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_payment_security_token")
*/
class PaymentSecurityToken extends BasePaymentSecurityToken
{
}
6 changes: 4 additions & 2 deletions src/Entity/Product/Product.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
use Sylius\Component\Core\Model\Product as BaseProduct;
use Sylius\Component\Product\Model\ProductTranslationInterface;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_product')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_product")
*/
class Product extends BaseProduct
{
protected function createTranslation(): ProductTranslationInterface
Expand Down
6 changes: 4 additions & 2 deletions src/Entity/Product/ProductAssociation.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Product\Model\ProductAssociation as BaseProductAssociation;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_product_association')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_product_association")
*/
class ProductAssociation extends BaseProductAssociation
{
}
6 changes: 4 additions & 2 deletions src/Entity/Product/ProductAssociationType.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
use Sylius\Component\Product\Model\ProductAssociationType as BaseProductAssociationType;
use Sylius\Component\Product\Model\ProductAssociationTypeTranslationInterface;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_product_association_type')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_product_association_type")
*/
class ProductAssociationType extends BaseProductAssociationType
{
protected function createTranslation(): ProductAssociationTypeTranslationInterface
Expand Down
6 changes: 4 additions & 2 deletions src/Entity/Product/ProductAssociationTypeTranslation.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Product\Model\ProductAssociationTypeTranslation as BaseProductAssociationTypeTranslation;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_product_association_type_translation')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_product_association_type_translation")
*/
class ProductAssociationTypeTranslation extends BaseProductAssociationTypeTranslation
{
}
6 changes: 4 additions & 2 deletions src/Entity/Product/ProductAttribute.php
Original file line number Diff line number Diff line change
Expand Up @@ -8,8 +8,10 @@
use Sylius\Component\Attribute\Model\AttributeTranslationInterface;
use Sylius\Component\Product\Model\ProductAttribute as BaseProductAttribute;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_product_attribute')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_product_attribute")
*/
class ProductAttribute extends BaseProductAttribute
{
protected function createTranslation(): AttributeTranslationInterface
Expand Down
6 changes: 4 additions & 2 deletions src/Entity/Product/ProductAttributeTranslation.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Product\Model\ProductAttributeTranslation as BaseProductAttributeTranslation;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_product_attribute_translation')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_product_attribute_translation")
*/
class ProductAttributeTranslation extends BaseProductAttributeTranslation
{
}
6 changes: 4 additions & 2 deletions src/Entity/Product/ProductAttributeValue.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Product\Model\ProductAttributeValue as BaseProductAttributeValue;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_product_attribute_value')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_product_attribute_value")
*/
class ProductAttributeValue extends BaseProductAttributeValue
{
}
6 changes: 4 additions & 2 deletions src/Entity/Product/ProductImage.php
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,10 @@
use Doctrine\ORM\Mapping as ORM;
use Sylius\Component\Core\Model\ProductImage as BaseProductImage;

#[ORM\Entity]
#[ORM\Table(name: 'sylius_product_image')]
/**
* @ORM\Entity
* @ORM\Table(name="sylius_product_image")
*/
class ProductImage extends BaseProductImage
{
}
Loading

0 comments on commit 09b01b6

Please sign in to comment.