1

i am trying to call two tables to call them names and insert it in a new table.

This is model code.

public function fetchAll()
{
    $resultSet = array(
            $this->getDbTable()->fetchAll(),        
            $JournalisticDataBase = new Application_Model_JournalisticMapper(),
            $SponosorDataBase = new Application_Model_GuestbookMapper() );
    $entries   = array();
    foreach ($resultSet as $row) {
        $entry = new Application_Model_JournalisticSponsor();
        $entry->setJS_ID($row->JS_ID)
              ->setJ_fullname($row->J_fullname)
              ->setS_fullname($row->S_fullname)
              ->setJS_VisitDate($row->JS_VisitDate);

        $entries[] = $entry;
    }
    return $entries;
} 
3
  • Please be more specific: what is the desired outcome, what do you get now, are there any errors etc. etc. Commented May 12, 2013 at 16:59
  • i want to take name from table and other name from other table then fetch all results to show it in new table. the error is: Cannot redeclare Application_Model_JournalisticSponsorMapper::fetchAll() Commented May 13, 2013 at 5:53
  • please be more specific, as of now you question and your code makes very little sense. Commented May 13, 2013 at 10:50

1 Answer 1

1

might i would just suggest to change your method name which define in model

public function fetchAll() to any other like `public function fetchData()` 

or something which would be as per zend or coding standard

may be this could be happen to make same function name as zend DB class already consist.

Please let me know if i can help you more.

Sign up to request clarification or add additional context in comments.

1 Comment

thank you, that wasn't the big deal, i am trying to join tables in zend model then fetch them to show them in view.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.