Zend Dd Rowset getting parent row

Posted by simple on Stack Overflow See other posts from Stack Overflow or by simple
Published on 2010-03-31T07:18:00Z Indexed on 2010/03/31 7:23 UTC
Read the original article Hit count: 301

Filed under:
|

I am wondering about using the abstraction in Zend Db RowSet instead of joins, is it possible for instance I am able to get some info from parent table as in here

/**
 * Get default photo info (path , description)
 */
public function getDefaultPhotoInfo($userdId){

    $select = $this->select($this)
            ->where('id=?', $userdId);
    $rowset = $this->fetchAll($select);
    $current = $rowset->current();

    $res = $current->findParentRow('UserPhotos', 'Avatar');
    if(isset($res)){
        return $res->toArray();
    }
}

How can I use Rowset abstraction to get this logic working

table( id, pic_path,) table_translation(id, table_id, lang_id, pic_title);

the above is representation of two tables , the idea is to get the info from both table specifying the lang_id , it is easy with joins but can I do it with the abstraction of Db Rowset ?

© Stack Overflow or respective owner

Related posts about php

Related posts about zend-framework