Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 7750603
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 1, 20262026-06-01T11:20:01+00:00 2026-06-01T11:20:01+00:00

i have a problem with doctrine. I have a filemanager with folders and files.

  • 0

i have a problem with doctrine.
I have a filemanager with folders and files.

Now i want to save groups to an directory or an single file.
For a single item it works.

But if i want to save the group rights recursive it wont work.
Doctrine doesn’t throw an error or an exception. But it saves no changes to the subdirs and files in the subdirs.

This is my Model:

http://pastebin.com/nK6MqiiS

Both Models Model_File_Item and Model_File_Dir extend this Model.
Everything works finde until the method “setGroupsRecursive()” want to save the group to the dir or file.

I’ve writed logs in the file.. everything is fine and every item will be saved but the changes don’t be saved in the database and i dont know why.

EDIT: the group definition looks like this:

Model_File_Dir & Model_File_Item:

/**
 * Owning Side
 *
 * @ManyToMany(targetEntity="Model_Group", inversedBy="dirs")
 * @JoinTable(name="dir_groups",
 *      joinColumns={@JoinColumn(name="dir_id", referencedColumnName="id")},
 *      inverseJoinColumns={@JoinColumn(name="group_id", referencedColumnName="id")}
 *      )
 */
protected $groups;

and the Model_Group looks like this:

/**
 * @ManyToMany(targetEntity="Model_File_Dir", mappedBy="groups")
 */
protected $dirs;

/**
 * @ManyToMany(targetEntity="Model_File_Item", mappedBy="groups")
 */
protected $files;
  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-01T11:20:02+00:00Added an answer on June 1, 2026 at 11:20 am

    I think you need cascade operations for this. Think wisely using bi-directional relationships (especially using cascade operations) as described here and here. Hope this helps!

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I have problem with uploading files. I followed these instructions: http://symfony.com/doc/current/cookbook/doctrine/file_uploads.html and everything is
I have i little problem with save Tags of an Portfolio with Doctrine. I
I have a problem with the inheritance of Doctrine within my fixtures.yml file of
I have problem with return statment >.< I want to store all magazine names
I have problem with fancybox. I want to write a function that will run
I have a doctrine update query to save my data: $customer = Doctrine_Query::create() ->update('Customer')
I have what I assume is a configuration problem with my Doctrine schema.yml, but
I'm going through tutorials for doctrine and have come across a problem. Does the
I have recently started to learn using of Doctrine 2.0 framework for PHP. Now
I'm using Doctrine 2 ORM and I have this problem. I have three Entities,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.