Hi friends!
I put a metodo _list() in the class ProductTable
public function _list(){
return $this->createQuery()
->from('Product prod')
->execute();
}
And I can return dates like HYDRATE_RECORD
$objProducts = Doctrine::getTable('Product')->_list();
foreach($objProducts as $objProduct){
echo "<br/>Name: ".$objProduct->prod_name;
}
However, for CategoryTable with the same method
public function _list(){
return $this->createQuery()
->from('Category cat')
->execute();
}
I cant return dates like HYDRATE_RECORD
$objCategorys = Doctrine::getTable('Category')->_list();
foreach($objCategories as $objCategory){
echo "<br/>Name: ".$objCategory->cat_name;
}
I just can return dates of Category using HYDRATE_ARRAY
in BaseProduct exists the hasOne method
in BaseCategory exists the hasMany method
both with right connexions.
Any idea?
Thanks