Skip to content

Instantly share code, notes, and snippets.

@igormukhingmailcom
igormukhingmailcom / PriceAwareProductFixtureTrait.php
Last active Jul 8, 2020
Enable ability to specify Product's price/originalPrice at Sylius fixtures
View PriceAwareProductFixtureTrait.php
<?php
declare(strict_types=1);
namespace App\Fixture;
use Symfony\Component\Config\Definition\Builder\ArrayNodeDefinition;
trait PriceAwareProductFixtureTrait
{
@igormukhingmailcom
igormukhingmailcom / STUPID_SYLIUS_ISSUES.md
Last active Jul 29, 2022
Symfony/Sylius stupid issues that hard to debug and which may waste too many hours
View STUPID_SYLIUS_ISSUES.md

Symfony/Sylius stupid issues that hard to debug and which may waste too many hours

1. [Doctrine\Common\Persistence\Mapping\MappingException] Class 'Your\SyliusPlugin\Entity\YourEntity' does not exist

When your plugin is AbstractResourceBundle and all your entities should be and actually placed at Model directory, you have that exception (notice ...\Entity\... at exception rather than ..\Model\...) for your Your\SyliusPlugin\Model\YourEntity.php that is weird.

This happens when you accidentally have your mapping file at src/Resources/config/doctrine/YourEntity.orm.xml (without ../model/.. part) rather than src/Resources/config/doctrine/model/YourEntity.orm.xml.

This issue may happen when you convert some of your application code (which use Entity directory) to plugin (which use Model directory).

View AbstractSegmentedRepresentation.yml
# config/serializer/hateoas/AbstractSegmentedRepresentation.yml
Hateoas\Representation\AbstractSegmentedRepresentation:
exclusion_policy: ALL
expose: false
properties:
limit:
expose: true
groups: [ Default, Hateoas ]
total:
expose: true
@igormukhingmailcom
igormukhingmailcom / sylius-tips.md
Last active Mar 28, 2019
Sometime we can face some weird issue and spend a lot of time to find why it happen. Here I will be collecting some issues and reasons why they happening.
View sylius-tips.md
  • Fixture with name ""your_cusom_fixture"" is already registered.
    • Reason: Your fixture service registers twice (as app.fixture.bla by you and as App\Fixture\BlaFixture by DI autoconfigure)
    • Solutions:
      • Exclude fixtures folder from DI autoconfigure
      • Make your fixture comatible with DI autocomfigure
    • How that was found: Dumped $taggedServices at vendor/sylius/fixtures-bundle/src/DependencyInjection/Compiler/FixtureRegistryPass.php
View keybase.md

Keybase proof

I hereby claim:

  • I am igormukhingmailcom on github.
  • I am igormukhin (https://keybase.io/igormukhin) on keybase.
  • I have a public key whose fingerprint is 5F5A 5E52 6A5E F02E 77A1 8419 241F CD97 41E5 A625

To claim this, I am signing this object:

@igormukhingmailcom
igormukhingmailcom / README.md
Created May 16, 2015
Symfony2 configuration for file uploads & cropping at EasyAdminBundle with JbFileUploaderBundle for multiple entities
View README.md
View pedantically_commented_playbook.yml
---
# ^^^ YAML documents must begin with the document separator "---"
#
#### Example docblock, I like to put a descriptive comment at the top of my
#### playbooks.
#
# Overview: Playbook to bootstrap a new host for configuration management.
# Applies to: production
# Description:
# Ensures that a host is configured for management with Ansible.