doctrine-extensions

Symfony exception when registering new Doctrine event subscriber (SoftDeleteable)

隐身守侯 提交于 2019-12-13 07:40:51
问题 I'm using Symfony 2.3 with Sonata Admin Bundle with DoctrineExtensions (which is enabled by StofDoctrineExtensionsBundle). I enabled, configured and successfully tested SoftDeleteable and Timestampable components. Now, when I try adding another Doctrine event subscriber using Symfony tagged service, it seems as the softdeleteable listener is being disabled. My service: my.contact.listener.tag: class: My\ContactBundle\EventListener\TagListener tags: - { name: doctrine.event_subscriber,

Doctrine FIND_IN_SET leads to Error: Expected end of string, got '('

霸气de小男生 提交于 2019-12-12 03:29:45
问题 I've got the following doctrine query in Symfony2: $query = $em ->createQuery(" SELECT m FROM MyBackendBundle:Merchant m WHERE m.active = :active ORDER BY FIND_IN_SET(m.range, 'all', 'without_special'), m.tradingAmount DESC ") ->setParameter('active', true) ; But this leads to the following error: [Syntax Error] line 0, col 112: Error: Expected end of string, got '(' and: QueryException: SELECT m FROM My\Bundle\BackendBundle\Entity\Merchant m WHERE m.active = :active ORDER BY FIND_IN_SET(m

Why is DoctrineExtensions Blameable eagerly fetching all created_by users

浪子不回头ぞ 提交于 2019-12-11 13:28:52
问题 When using the following trait in my user class /** * @var User * * @Gedmo\Blameable(on="create") * @ORM\ManyToOne(targetEntity="User") */ protected $createdBy; /** * @var User * * @Gedmo\Blameable(on="update") * @ORM\ManyToOne(targetEntity="User") */ protected $updatedBy; Whenever i query a user the createdBy user is also fetched and this goes on recursively.. So if user C that was created by B, that was created by A is queried. All three users will be fetched... Is there a way to disable

Symfony2: problems rendering the translation-form with A2lixTranslationFormBundle and Gedmo\DoctrineExtensions Translatable

百般思念 提交于 2019-12-10 23:04:06
问题 I'm using gedmo/doctrine-translations and a2lix/translation-form-bundle: 2.*@dev to translate my entities. The translation form always renders a Field and Content but my entity itself doesn't contain a Field or Content field. The form type $builder->add('translations', 'a2lix_translations'); 回答1: The 2.0 version of the TranslationFormBundle isn't compatible with the current gedmo/doctrine-extensions version. See the bundle's upgrade notes . You'll need to use the currently unstable branches

translation-form with default entity translations not found

南笙酒味 提交于 2019-12-10 21:21:12
问题 i try setup translations form http://a2lix.fr/bundles/translation-form/ and https://github.com/Atlantic18/DoctrineExtensions/blob/master/doc/translatable.md#translatable-entity-example composer.json "a2lix/translation-form-bundle": "2.*@dev", "stof/doctrine-extensions-bundle": "1.2.*@dev", config.yml stof_doctrine_extensions: default_locale: en orm: default: translatable: true sluggable: true sluggable: true timestampable: true a2lix_translation_form: locale_provider: default # [1] locales:

Sonata and Gedmo\\References doctrine extension doesn't work ( Class does not exist )

人盡茶涼 提交于 2019-12-08 12:55:32
I want to link the doctrine orm entity and doctrine odm document and use them in sonataAdminBundle in configureFormFields Method of the Admin Class. I've established the @Gedmo\References doctrine-extension and it works just fine when i'm trying to access the linked models from controller. But now I need to do it from SonataAdminBundle - to make an UI to add the linked documents to the user entity. Here is my entity: <?php namespace Application\Sonata\UserBundle\Entity; use Doctrine\ORM\Mapping as ORM; use Sonata\UserBundle\Entity\BaseUser; use FOS\UserBundle\Model\GroupInterface; use Sonata

Gedmo Doctrine Extensions - Sluggable + Translatable Yaml Configuration

筅森魡賤 提交于 2019-12-06 17:48:12
问题 I'm trying to translate entities with gedmo doctrine extensions. https://github.com/Atlantic18/DoctrineExtensions I'm using yml as orm mapping file (auto generating entities). orm.yml: CS\ContentBundle\Entity\Post: type: entity table: posts repositoryClass: CS\ContentBundle\Entity\PostRepository gedmo: soft_deleteable: field_name: deleted_at translation: locale: locale fields: id: type: integer length: 11 id: true generator: strategy: AUTO title: type: string length: 500 gedmo: - translatable

Gedmo Doctrine Extensions - Sluggable + Translatable Yaml Configuration

…衆ロ難τιáo~ 提交于 2019-12-04 23:08:02
I'm trying to translate entities with gedmo doctrine extensions. https://github.com/Atlantic18/DoctrineExtensions I'm using yml as orm mapping file (auto generating entities). orm.yml: CS\ContentBundle\Entity\Post: type: entity table: posts repositoryClass: CS\ContentBundle\Entity\PostRepository gedmo: soft_deleteable: field_name: deleted_at translation: locale: locale fields: id: type: integer length: 11 id: true generator: strategy: AUTO title: type: string length: 500 gedmo: - translatable slug: type: string length: 500 gedmo: translatable: {} slug: separator: - fields: - title I can

Symfony2/Doctrine: Get the field(s) that changed after “Loggable” entity changed

不想你离开。 提交于 2019-12-04 15:24:43
问题 In a Symfony2 project I'm using the Loggable Doctrine Extension. I saw that there is a LoggableListener. Is there indeed an event that gets fired when a (loggable) field in a loggable entity changes? If it is so, is there a way to get the list of fields that triggered it? I'm imagining the case of an entity with, let's say 10 fields of which 3 loggable. For each of the 3 I want to perform some actions if they change value, so 3 actions will be performed if the 3 of them change. Any idea?

Symfony2/Doctrine: Get the field(s) that changed after “Loggable” entity changed

て烟熏妆下的殇ゞ 提交于 2019-12-03 08:44:01
In a Symfony2 project I'm using the Loggable Doctrine Extension. I saw that there is a LoggableListener. Is there indeed an event that gets fired when a (loggable) field in a loggable entity changes? If it is so, is there a way to get the list of fields that triggered it? I'm imagining the case of an entity with, let's say 10 fields of which 3 loggable. For each of the 3 I want to perform some actions if they change value, so 3 actions will be performed if the 3 of them change. Any idea? Thank you! EDIT After reading the comment below and reading the docs on doctrine's events I understood have