public function fetchAllJoin($key=null,$condition=null) { if($condition == null) { $resultSet = $this->getDbTable()->fetchAll(); } else { $resultSet = $this->getDbTable()->search($key,$condition); } $entries = array(); foreach ($resultSet as $row) { $entry = new Vendor_Models_Vendor(); $entry ->setVId($row->vId) ->setName($row->name) ->setContact($row->contact) ->setTypeId($row->typeId) ->setPhoneNo($row->phoneNo) ->setOtherContact($row->otherContact) ->setAddress($row->address) ->setContactId($row->contactId); $contacts = new Employee_Models_ContactMapper(); $contactName = $contacts->findContactName($entry->getContactId()); $vtypes = new General_Models_VtypeMapper(); $typeName = $vtypes->findTypeName($entry->getTypeId()); $entry->setTypeName($typeName); $entry->setContactName($contactName); $entries[] = $entry; } return $entries; }