nodoso 0 Newbie Poster

Hi everybody,

I have some difficulties getting my objects mapped from a query.

My query is this one:

$this->myPlanes = Doctrine_Query::create()
                ->from('FsPlane p')
                ->leftJoin('p.FsPlanetech t')
                ->leftJoin('t.FsPicture')
                ->where('player_id = ?', $id)
                ->execute();

But when I want to retrieve my objects FsPicture I get something strange
code:

foreach ($myPlanes as $key => $iterPlane) {
            $picture = $iterPlane->FsPlanetech->getFsPicture();

}

$picture is a object(sfOutputEscaperIteratorDecorator)
Which is not what I want I just want my object from the db mapped.


My schema.yml

FsPlane:
       actAs: { Timestampable: ~  }
       columns:
              id: { type: integer, notnull: true, autoincrement:true, primary:true }
              player_id: { type: integer, notnull: false }
              planetech_id: { type: integer, notnull: false }
              pilot_id: { type: integer, notnull: false, unique: true }
              copilot_id: { type: integer, notnull: false, unique: true }
       relations:
              FsPlayer: { onDelete: CASCADE, local: player_id, foreign: id }
              FsPlanetech: { onDelete: CASCADE, local: planetech_id, foreign: id }
              FsPilot: { onDelete: CASCADE, local: pilot_id, foreign: id, class: FsEmployee }
              FsCoPilot: { onDelete: CASCADE, local: copilot_id, foreign: id, class: FsEmployee }

FsPlanetech:
       actAs: 
       columns:
              id: { type: integer, notnull: true, autoincrement:true, primary:true }
              manufacturer: { type: string(255), notnull: true }
              model: { type: string(255), notnull: true }
              type: { type: string(255), notnull: true }
              weight: { type: integer, notnull: true }
              maxweight: { type: integer, notnull: true }
              speed: { type: float, notnull: true }
              maxspeed: { type: float, notnull: true }
              landingspeed: { type: float, notnull: false }
              maxpassengers: { type: integer, notnull: true }
              nrofreactors: { type: integer, notnull: true }
              price: {type: integer, notnull: true }


FsPicture:
       columns:
             id: { type: integer, notnull: true, autoincrement:true, primary:true }
             picture: { type: string(255) }
             plane: {type: integer }
       relations:
             FsPlanetech: {onDelete: CASCADE, local: plane, foreign: id}

Greetz
Nodoso

Be a part of the DaniWeb community

We're a friendly, industry-focused community of developers, IT pros, digital marketers, and technology enthusiasts meeting, networking, learning, and sharing knowledge.