Doksh
Doksh

Reputation: 143

Fetch columns from database using zend

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;
} 

Upvotes: 1

Views: 352

Answers (1)

liyakat
liyakat

Reputation: 11853

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.

Upvotes: 1

Related Questions