<?php
class Album extends Zend_Db_Table
	
{
	protected $_name ="oophp_album";
	protected $_primary = 'id';
	protected $_dependentTables=array('Photo');
	public function getArticlesById($id)
	 {
	  $select = $this -> select()-> from('oophp_photo',array('id','title','albumid'));
	  $category = $this -> find($id) -> current();
	  $articles = $category -> findDependentRowset('Photo', 'albums', $select) -> toArray();
	  $rowset = $category -> toArray();
	  $rowset['photo'] = $articles;
	  return $rowset;
	 }
	
}