I am working on project which is in symfony 1.0 I have created result set in action file as follows
$perform = new Criteria();
$perform->clearSelectColumns();
$perform->addSelectColumn(ProductionPeer::PREVIEW_DATE);
$perform->addSelectColumn(ProductionPeer::OPENED);
$perform->addSelectColumn(ProductionPeer::CLOSED);
$perform->addSelectColumn(ProductionPeer::PERFORMANCES);
$perform->addSelectColumn(VenuePeer::NAME);
$perform->addJoin(ProductionPeer::VENUE_ID, VenuePeer::ID, Criteria::LEFT_JOIN);
$perform->add(ProductionPeer::TITLE_ID,3);
$this->performRsCnt = ProductionPeer::doCount($perform);
if($this->performRsCnt > 0)
{
$this->performRs = ProductionPeer::doSelectRS($perform);
$this->performRs->setFetchmode(ResultSet::FETCHMODE_ASSOC);
}
when I print_r($this->performRs) in action itself then it gives desired output
Now the problem is I have created one pratial file which is included in success file and in partial file there is component included within partial file. when I print my action object i.e. $performRs before include code for component then it gives desired output but when i print after include code then it overwrite by last result set which is in component
below is sample code for component
component file code
class defaultComponents extends sfComponents
{
public function executeMediaDetail()
{
$mediaHardeep = new Criteria();
$mediaHardeep->addSelectColumn(PhotosPeer::PHOTO);
$mediaHardeep->addSelectColumn(PhotosConcernsPeer::PHOTOS_ID);
$mediaHardeep->addJoin(PhotosConcernsPeer::PHOTOS_ID, PhotosPeer::ID, Criteria::LEFT_JOIN);
$mediaHardeep->add(PhotosConcernsPeer::REF_ID, $this->ref_id);
$mediaHardeep->add(PhotosConcernsPeer::TYPE, $this->type);
$imgRsCntHardeep = PhotosConcernsPeer::doCount($mediaHardeep);
}
}
component include code in partial
<?php print_r($performRs);?> //desired output
<!-- start media section -->
<?php include_component('default', 'mediaDetail',array('ref_id' => $titleData['ID'], 'type' => 'title','abc123'=>$abcRs));?>
<!-- end media section -->
<?php print_r($performRs);?> //gives the output of $imgRsCntHardeep which is in component
I have checked my code multiple times and I assure that code does not contain any type of errors like variable mismatch, passing variable to partial or component, using variable name multiple time. I hope I will find solution from here because I am solving this problem since saturday