Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8526019
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 11, 20262026-06-11T08:08:59+00:00 2026-06-11T08:08:59+00:00

I am reading Survive the deep end . There I read the following section:

  • 0

I am reading Survive the deep end. There I read the following section:

    $this->_mapper->save($entry);
    $this->assertEquals(123, $entry->id);

Code for mapper::save is as follows:

    public function save(ZFExt_Model_Entry $entry) {
    if(!$entry->id) {
        $data = array(
            'title' => $entry->title,
            'content' => $entry->content,
            'published_date' => $entry->published_date,
            'author_id' => $entry->author->id
        );
        $entry->id = $this->_getGateway()->insert($data);
                    ....contd

As you can see the variable is not passed by reference, then how the value will get changed in $entry in the calling function ? (i.e; $this->_mapper->save($entry); $this->assertEquals(123, $entry->id);)

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-11T08:09:01+00:00Added an answer on June 11, 2026 at 8:09 am

    Objects are always passed by reference.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

i was reading Zend Framework Book: Survive the Deep End about resource methods. it
Reading the MCIMX50 Application Processor Reference Manuals on page 1368 (Section 33.3) there is
Reading the Scala by Example book and there is this example when Martin explains
Reading code from other posts, I'm seeing something like this. struct Foo { Foo()
Reading this question I found this as (note the quotation marks) code to solve
Reading the code of the C library's sockets interface, I found this: /* Types
Reading this list of Chrome match patterns: http://code.google.com/chrome/extensions/match_patterns.html How do I specify a match
Reading the documentation I thought this code would write logs to a file in
Reading through this excellent article about safe construction techniques by Brain Goetz, I got
Reading source code of my current project, I see: [self retain] in one class,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.