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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 15, 20262026-05-15T04:49:48+00:00 2026-05-15T04:49:48+00:00

I’m trying to set some conditional statements for nested embedRelation() instances, and can’t find

  • 0

I’m trying to set some conditional statements for nested embedRelation() instances, and can’t find a way to get any kind of option through to the second embedRelation.

I’ve got a “Measure->Page->Question” table relationship, and I’d like to be able to choose whether or not to display the Question table. For example, say I have two “success” pages, page1Success.php and page2Success.php. On page1, I’d like to display “Measure->Page->Question”, and on page2, I’d like to display “Measure->Page”, but I need a way to pass an “option” to the PageForm.class.php file to make that kind of decision. My actions.class.php file has something like this:


// actions.class.php
$this->form = new measureForm($measure, array('option'=>$option));

to pass an option to the “Page”, but passing that option through “Page” into “Question” doesn’t work.

My measureForm.class.php file has an embedRelation in it that is dependent on the “option”:


// measureForm.class.php
if ($this->getOption('option') == "page_1") {
    $this->embedRelation('Page');
}

and this is what i’d like to do in my pageForm.class.php file:


// pageForm.class.php
if ($this->getOption('option') == "page_1") { // Or != "page_2", or whatever
    $this->embedRelation('Question');
}

I can’t seem to find a way to do this. Any ideas?

Is there a preferred Symfony way of doing this type of operation, perhaps without embedRelation?

Thanks,
-Trevor

As requested, here’s my schema.yml:


# schema.yml
Measure:
  connection: doctrine
  tableName: measure
  columns:
    _kp_mid:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: true
    description:
      type: string()
      fixed: false
      unsigned: false
      primary: false
      notnull: false
      autoincrement: false
    frequency:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: false
      notnull: false
      autoincrement: false
  relations:
    Page:
      local: _kp_mid
      foreign: _kf_mid
      type: many
Page:
  connection: doctrine
  tableName: page
  columns:
    _kp_pid:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: true
    _kf_mid:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: false
      notnull: false
      autoincrement: false
    next:
      type: string()
      fixed: false
      unsigned: false
      primary: false
      notnull: false
      autoincrement: false
    number:
      type: string()
      fixed: false
      unsigned: false
      primary: false
      notnull: false
      autoincrement: false
    previous:
      type: string()
      fixed: false
      unsigned: false
      primary: false
      notnull: false
      autoincrement: false
  relations:
    Measure:
      local: _kf_mid
      foreign: _kp_mid
      type: one
    Question:
      local: _kp_pid
      foreign: _kf_pid
      type: many
Question:
  connection: doctrine
  tableName: question
  columns:
    _kp_qid:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: true
      autoincrement: true
    _kf_pid:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: false
      notnull: false
      autoincrement: false
    text:
      type: string()
      fixed: false
      unsigned: false
      primary: false
      notnull: false
      autoincrement: false
    type:
      type: integer(4)
      fixed: false
      unsigned: false
      primary: false
      notnull: false
      autoincrement: false
  relations:
    Page:
      local: _kf_pid
      foreign: _kp_pid
      type: one
  • 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-05-15T04:49:49+00:00Added an answer on May 15, 2026 at 4:49 am

    I’ve decided to use embedForm() instead. It ended up being some Doctrine_Query::create()->select()… and Doctrine::getTable commands followed by some foreach loops and embedForm statements. So much for embedRelation!

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

Sidebar

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.