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

  • SEARCH
  • Home
  • 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 6118135
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 23, 20262026-05-23T15:24:04+00:00 2026-05-23T15:24:04+00:00

I am using Doctrine 2 and Zend Framework 1.11. I have set up my

  • 0

I am using Doctrine 2 and Zend Framework 1.11. I have set up my Doctrine intergration and it seams to be working in that, I able to get and instance on an Entity Manager to work with. However, I am baffled by the behaviour of the following line in the controller class:

$transfercurrency = $this->entityManager->getRepository('Gesmoney\Entity\Country')->findBy(array('countrycode' => $transfercountry));

When I do a var_dump($transfercurrency), I get an object with a whole bunch of properties, infact, it doesn’t look right to me. I tried to post it on pastie but it will not let me because its more than 100kb. I therefore just pasted about a quarter of it enter link description here. Also using Netbeans there seem to be no properties or methods for the returned object hence when I invoke code complete I get nothing. When I do var_dump($transfercurrency[0]->id), I get the following error;

Notice: Undefined property:
Gesmoney\Entity\Country::$property in
/shared/www/dev.gesmoneylatest.com/library/Gesmoney/Entity/Country.php
on line 55 NULL

Its quite a long post but I hope someone has the answer to my problem. Thanks.

Controller class

<?php

class Systemadmin_ExchangerateController extends Zend_Controller_Action
{
/**
 * @var Bisna\Application\Container\DoctrineContainer
 */
protected $doctrine;

/**
 * @var Doctrine\ORM\EntityManager
 */
protected $entityManager;

public function init()
{
    $this->doctrine = Zend_Registry::get('doctrine');
    $this->entityManager = $this->doctrine->getEntityManager();
}

public function indexAction()
{
    // action body
}


public function getexchangerateAction($transfercountry = 'GB') {

    $this->_helper->layout()->disableLayout();
    $this->_helper->viewRenderer->setNoRender(true);

    $transfercurrency = $this->entityManager->getRepository('Gesmoney\Entity      \Country')->findBy(array('countrycode' => $transfercountry));
    var_dump($transfercurrency);
}

}

Entity

<?php

 namespace Gesmoney\Entity;
 /**
 * @Entity @Table(name="countries")
 */
 class Country {
/**
 * @Id @Column(type="integer", length=3, nullable=false) 
 * @GeneratedValue(strategy="IDENTITY")
 * @var integer
 * 
 */
private $id;

/**
 * @Column(type="string", length=25)
 * @var string
 */
private $countryname;

/**
 * @Column(type="datetime")
 * @var string
 */
private $lastupdate;

/**
 * @Column(type="string", length=2)
 * @var string
 */
private $countrycode;

/**
 * @Column(type="string", length=20)
 * @var string
 */
private $countrycurrency;

/**
 * @Column(type="string", length=3)
 * @var string
 */
private $currencycode;


/**
 * @param \Doctrine\Common\Collections\Collection $property
 * @OneToMany(targetEntity="Region", mappedBy="country", cascade={"persist", "remove"})
 */
private $region;


public function __get($property) {
    return $this->property;
}

public function __set($property, $value) {
    $this->property = $value;
}

}

Application.ini excerpt

;; added for Doctrine2 Integration
pluginPaths.Bisna_Application_Resource = "Bisna/Application/Resource"

; ------------------------------------------------------------------------------
; Doctrine Cache Configuration
; ------------------------------------------------------------------------------

; Points to default cache instance to be used. Optional is only one cache is defined
resources.doctrine.cache.defaultCacheInstance = default

; Cache Instance configuration for "default" cache
resources.doctrine.cache.instances.default.adapterClass = "Doctrine\Common\Cache\ArrayCache"
resources.doctrine.cache.instances.default.namespace    = "Application_"

; ------------------------------------------------------------------------------
; Doctrine DBAL Configuration
; ------------------------------------------------------------------------------

; Points to default connection to be used. Optional if only one connection is defined
resources.doctrine.dbal.defaultConnection = default

; Database configuration
;resources.doctrine.dbal.connections.default.parameters.wrapperClass = ""
resources.doctrine.dbal.connections.default.parameters.driver   = "pdo_mysql"
resources.doctrine.dbal.connections.default.parameters.dbname   = "zzzzz"
resources.doctrine.dbal.connections.default.parameters.host = "localhost"
resources.doctrine.dbal.connections.default.parameters.port = zzzz
resources.doctrine.dbal.connections.default.parameters.user = "root"
resources.doctrine.dbal.connections.default.parameters.password = ""


; ------------------------------------------------------------------------------
; Doctrine ORM Configuration
; ------------------------------------------------------------------------------

; Points to default EntityManager to be used. Optional if only one EntityManager is defined
resources.doctrine.orm.defaultEntityManager = default

; EntityManager configuration for "default" manager
resources.doctrine.orm.entityManagers.default.connection     = default
resources.doctrine.orm.entityManagers.default.proxy.autoGenerateClasses = true
resources.doctrine.orm.entityManagers.default.proxy.namespace           = "Gesmoney\Entity\Proxy"
resources.doctrine.orm.entityManagers.default.proxy.dir                 = APPLICATION_PATH "/../library/Gesmoney/Entity/Proxy"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.adapterClass          = "Doctrine\ORM\Mapping\Driver\AnnotationDriver"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.mappingNamespace      = "Gesmoney\Entity"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.mappingDirs[]         = APPLICATION_PATH "/../library/Gesmoney/Entity"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.annotationReaderClass = "Doctrine\Common\Annotations\AnnotationReader"
resources.doctrine.orm.entityManagers.default.metadataDrivers.0.annotationReaderCache = default
  • 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-05-23T15:24:05+00:00Added an answer on May 23, 2026 at 3:24 pm

    You forgot the $ on your properties for __get and __set

    public function __get($property) {
        return $this->$property;
    }
    
    public function __set($property, $value) {
        $this->$property = $value;
    }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I've been working with Zend Framework (using Doctrine as the ORM) for quite a
I have a CMS application written using the Zend Framework that allows you to
I'm using Doctrine 1.2 as my ORM for a Zend Framework Project. I have
When creating an association using Doctrine 2 and the Zend Framework, if the associated
I'm using Doctrine with Zend Framework. For my model, I'm using a base class,
I'm using Zend Framework with Doctrine. I'm creating an object, editing, then saving it.
I am using Doctrine 1.2 under the Zend framework to run my database queries.
I am developing using zend framework and doctrine2.1. I have generated entities from database.
I'm using Doctrine 2 in a Zend Framework application and require functionality similar to
I'm currently developing a Zend Framework project, using Doctrine as ORM. I ran into

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.