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 8469447
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 10, 20262026-06-10T16:13:51+00:00 2026-06-10T16:13:51+00:00

How to get objects from the many table record? I have list of rsObjectComments

  • 0

How to get objects from the “many” table record?

I have list of rsObjectComments and I need to fetch rsObjects.

For example:

schema.yml:

rsObject:
  actAs:
    Timestampable: ~ 
    Sluggable:
      fields: [name]
  columns:
    name: { type: string(255), notnull: true, unique: true }
    description:  { type: string(6000), notnull: true }
  relations:
    rsObjectComments:
     class:        rsObjectComments
     local:        id
     foreign:      rsobject_id
     type:         many
     foreignAlias: Comments

rsObjectComments:
  actAs:
    Timestampable: ~
  columns:
    rsobject_id: { type: integer, notnull: true }
    fromname: { type: string(100), notnull:true }
    fromemail: { type: string(100), notnull:true }
    comments: { type: string(1000), notnull:true }    
    is_public: { type: boolean, notnull: true, default: 1 }
  relations:
    rsObject: { onDelete: CASCADE, local: rsobject_id, foreign: id, foreignAlias: rsObjectCommentsAlias } 
  • 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-10T16:13:53+00:00Added an answer on June 10, 2026 at 4:13 pm

    I encourage you to read the whole documentation page called: Inside The Model Layer (Doctrine) (specially the part Retrieving Related Record).

    You will see a basic example of article with many comments (which is almost the same as yours).

    For your example, if you have a rsObject you can fetch related rsObjectComments using:

    // will return a Doctrine_Collection
    $rsObjectComments = $rsObject->getComments();
    

    I’m using getComments because you defined the foreignAlias with Comments.

    And if you want to work on them

    foreach ($rsObject->getComments() as $comment)
    {
      // $comment is a rsObjectComments object
    }
    

    And in the reverse order, if you have a comment and want to retrieve its article.

    $rsObject = $comment->getRsObject();
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I want to get a list of objects from the database between a given
I am trying to get a list of objects from the Database based on
In many places in our code we have collections of objects, from which we
I have some .NET 4 entity framework objects that I get from the DB,
from django.contrib.auth.models import User u = User.objects.get(username='test') user.password u'sha1$c6755$66fc32b05c2be8acc9f75eac3d87d3a88f513802 Is reversing this password encryption
Following works fine in shell: >>> from django.contrib.auth.models import User >>> user=User.objects.get(pk=1) >>> user.first_name
I'm using HtmlAgilityPack how can I get the domain from the following objects? private
I have a table Product. Product is related to ProductDescription in a one-to-many relationship.
I have a table, say STUDENTS, that is related one-to-many to another table, CLASSES.
I'm trying to delete a row from my table view and so far have

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.