stofdoctrineextensions

Doctrine blameable extension 'on change' doesn't work

故事扮演 提交于 2020-01-02 03:39:25
问题 I'm on symfony 2.6.3 with stof Doctrine extension. TimeStampable and SoftDeletable work well. Also Blameable "on create" and "on update" are working well too: /** * @var User $createdBy * * @Gedmo\Blameable(on="create") * @ORM\ManyToOne(targetEntity="my\TestBundle\Entity\User") * @ORM\JoinColumn(name="createdBy", referencedColumnName="id") */ protected $createdBy; /** * @var User $updatedBy * * @Gedmo\Blameable(on="update") * @ORM\ManyToOne(targetEntity="my\TestBundle\Entity\User") * @ORM

A2lixTranslationFormBundle with Stof DoctrineExtensionsBundle doesnt Show Any Tab

空扰寡人 提交于 2019-12-25 07:49:14
问题 I'm new to Symfony and Sonata. After following the instructions i installed Translatable, but i dont get any Tab in the form. Composer.json "stof/doctrine-extensions-bundle": "1.1.x-dev", "a2lix/translation-form-bundle": "2.x-dev" config.yml # Doctrine Configuration doctrine: dbal: driver: "%database_driver%" host: "%database_host%" port: "%database_port%" dbname: "%database_name%" user: "%database_user%" password: "%database_password%" charset: UTF8 # if using pdo_sqlite as your database

how to populate data in 'closure' table if we have existing hierachy using parent_id in Gedmo doctrine tree extension?

假装没事ソ 提交于 2019-12-24 17:03:36
问题 I have existing category hierarchy with parent_id column. I have configured Gedmo Tree extension and update schema. I can see 'level' column is added to category table and category_closure table is created. How do I populate the data in category_closure table. There are no $repo->verify(); $repo->recover(); methods for ClosureTreeRepository. I have tried updating category records so that to trigger TreeListener but still there is no data in category_closure. How do I populate hierarchy in

How to update left, right, level values on existing category hierarchy data using gedmo tree doctrine extension in symfony?

寵の児 提交于 2019-12-22 18:05:10
问题 http://sqlfiddle.com/#!9/1d4a6/1 I have existing hierarchical data for categories. I have been using traditional approach to get parent, child etc using parent_id. Now I am trying to use Gedmo doctrine extension for the same. I have installed the extension and updated schema. If I create new categories with parent child as given in documentation example, it works. It populates lft, lvl, rgt, root columns properly. $food = new Entity\Category(); $food->setTitle('Food'); $fruits = new Entity

Gedmo Tree getPath Error: Node is not related to this repository 500 Internal Server Error - InvalidArgumentException

怎甘沉沦 提交于 2019-12-20 07:27:41
问题 I am getting error: Node is not related to this repository 500 Internal Server Error - InvalidArgumentException UPDATE 1: it does not matter if I set up tree repository with traits or extend abstract repository the error is the same. UPDATE 2: Full stack trace http://pastebin.com/TtaJnyzf I want to output html tree with tree structure from database and specifically I need to get path from root to selected node . As I understand it, that is done with getPath() function. I am using: Symfony v3

Generating doctrine slugs manually

家住魔仙堡 提交于 2019-12-20 01:55:16
问题 I'm using sluggable behavior in my Symfony2 project, but now I would like to make many slugs for one page, based on different texts (current title, old title(s), users text from form input), and keep it in another table. And my question is - how to manually use doctrine extensions for any text? I can't find it anywhere. Perfect would be something like: /* careful - it's not a real, working code! */ $sluggable = new DoctrineSluggable(); $slug = $sluggable->generate('My own text!'); echo $slug;

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,

StofDoctrineExtension Tree entity: get the id of the parent in twig

◇◆丶佛笑我妖孽 提交于 2019-12-12 01:04:27
问题 I'm using DoctrineExtensions Tree for my entity account. I'm getting my results with the following: $repo = $em->getRepository('NRtworksChartOfAccountsBundle:Accounttree'); $arrayTree = $repo->childrenHierarchy(); Entity Accounttree is the classic entity following the doc: /** * @Gedmo\Tree(type="nested") * @ORM\Table(name="Accounttree") * use repository for handy tree functions * @ORM\Entity(repositoryClass="Gedmo\Tree\Entity\Repository\NestedTreeRepository") */ class Accounttree { /** *

Timestampable does not work with ORM and PostgreSQL database

丶灬走出姿态 提交于 2019-12-11 12:23:55
问题 I added support for Timestampable in my entity as follow: use Gedmo\Timestampable\Traits\TimestampableEntity; . I have updated my DB by running doctrine:schema:update --force but any time I try to insert a new record I get this message: SQLSTATE[23502]: Not null violation: 7 ERROR: null value in column "createdat" violates not-null constraint Why? I'm using latest Symfony 2.5.3 and PostgreSQL 9.2.9. This is the complete error: An exception occurred while executing 'INSERT INTO usuarios

Gedmo Tree getPath Error: Node is not related to this repository 500 Internal Server Error - InvalidArgumentException

早过忘川 提交于 2019-12-02 10:11:04
I am getting error: Node is not related to this repository 500 Internal Server Error - InvalidArgumentException UPDATE 1: it does not matter if I set up tree repository with traits or extend abstract repository the error is the same. UPDATE 2: Full stack trace http://pastebin.com/TtaJnyzf I want to output html tree with tree structure from database and specifically I need to get path from root to selected node . As I understand it, that is done with getPath() function. I am using: Symfony v3.0.6; Doctrine v2.5.4 StofDoctrineExtensionsBundle [1] in order to manage Tree structure. To setup Tree