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 718809
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 14, 20262026-05-14T05:34:11+00:00 2026-05-14T05:34:11+00:00

I am getting following error message when using Doctrine ORM in Codeigniter. ( !

  • 0

I am getting following error message when using Doctrine ORM in Codeigniter.

( ! ) Fatal error: Call to a member function getAttribute() on a non-object in C:\xampp\htdocs\giftshoes\system\database\doctrine\Doctrine\Record.php on line 1424
Call Stack
#   Time    Memory  Function    Location
1   0.0011  327560  {main}( )   ..\index.php:0
2   0.0363  3210720 require_once( 'C:\xampp\htdocs\giftshoes\system\codeigniter\CodeIgniter.php' )  ..\index.php:116
3   0.0492  3922368 Welcome->Welcome( ) ..\CodeIgniter.php:201
4   0.0817  6234096 CI_Loader->model( ) ..\welcome.php:14
5   0.0824  6248376 Shoes->__construct( )   ..\Loader.php:184
6   0.0824  6248424 Doctrine_Core::getTable( )  ..\Shoes.php:5
7   0.0824  6248424 Doctrine_Connection->getTable( )    ..\Core.php:1080
8   0.0824  6254304 Doctrine_Table->__construct( )  ..\Connection.php:1123
9   0.0841  6396128 Doctrine_Table->initDefinition( )   ..\Table.php:249
10  0.0841  6397472 Shoes->__construct( )   ..\Table.php:301
11  0.0841  6397680 Doctrine_Access->__set( )   ..\Access.php:0
12  0.0841  6397680 Doctrine_Record->set( ) ..\Access.php:60

——————Doctrine Table Definition————-

abstract class BaseShoes extends Doctrine_Record
{
    public function setTableDefinition()
    {
        $this->setTableName('shoes');
        $this->hasColumn('sku', 'integer', 11, array('primary' => true, 'autoincrement' => false));
        $this->hasColumn('name', 'string', 255);
        $this->hasColumn('keywords', 'string', 255);
        $this->hasColumn('description', 'string');
        $this->hasColumn('manufacturer', 'string', 20);
        $this->hasColumn('sale_price', 'double');
        $this->hasColumn('price', 'double');
        $this->hasColumn('url', 'string');
        $this->hasColumn('image', 'string');
        $this->hasColumn('category', 'string', 50);
    }

    public function setUp() {

    }
}

————————Doctrine Table Code ——————-

class ShoesTable extends Doctrine_Table
{
    function getAllShoes($from = 0, $total = 15)
    {
        $q = Doctrine_Query::create()
        ->from('Shoes s')
        ->limit($total)
        ->offset($from);

        return $q->execute(array(), Doctrine::HYDRATE_ARRAY);
    }

}

—————–Model Code—————–

class Shoes extends BaseShoes
{
    function  __construct() {
        $this->table = Doctrine::getTable('shoes');
    }
    public function getAllShoes()
    {
        $this->table->getAllShoes();
    }
}
  • 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-14T05:34:12+00:00Added an answer on May 14, 2026 at 5:34 am

    I suppose that :

    • Shoes extends BaseShoes — well, we can see that
    • BaseShoes extends Doctrine_Record

    Doctrine_Record has a __construct() method, which does a lot of stuff.

    If you re-define the __construct() method in one of your classes, it will override the __construct() method that’s defined in its parent class.

    Here :

    • your Shoes::__construct() method
    • overrides BaseShoes::__construct()
    • which itself doesn’t exist, so is the same as Doctrine_Record::__construct()
    • which seems to do some quite important Doctrine-related things 😉

    Not tested, but calling the parent’s constructor in your own constructor could help :

    class Shoes extends BaseShoes
    {
        function  __construct() {
            parent::__construct();
            $this->table = Doctrine::getTable('shoes');
        }
        public function getAllShoes()
        {
            $this->table->getAllShoes();
        }
    }
    

    And, as a reference, quoting the [**Constructors and Destructors**][1] page of the PHP manual :

    Note: Parent constructors are not called implicitly if the child class
    defines a constructor.
    In order to
    run a parent constructor, a call to
    parent::__construct() within the
    child constructor is required.

    Still, as a sidenote, I am not sure that defining your own constructor in a Model class, with Doctrine, is such a good idea — and I’ve never seen this done, actually, as far as I remember…

    And here’s a blog-post on the Doctrine’s blog, that seems to indicate I’m right (quoting, emphasis mine) :

    […] someone asked about the
    constructor of entities in Doctrine 2
    and whether or not it could be used.

    I think this is something worth
    writing about since in Doctrine 1
    this was not possible. The constructor
    was hi-jacked from you and used
    internally by Doctrine
    .

    And here’s the section of Doctrine’s 1.2 manual that’s relevant : [**Overriding the Constructor**][3] :

    Doctrine doesn’t allow you to override
    the Doctrine_Record::__construct()
    method but provides an alternative

    […]

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

Sidebar

Ask A Question

Stats

  • Questions 354k
  • Answers 354k
  • Best Answers 0
  • User 1
  • Popular
  • Answers
  • Editorial Team

    How to approach applying for a job at a company ...

    • 7 Answers
  • Editorial Team

    How to handle personal stress caused by utterly incompetent and ...

    • 5 Answers
  • Editorial Team

    What is a programmer’s life like?

    • 5 Answers
  • Editorial Team
    Editorial Team added an answer The thing to remember is that these are architectural patterns… May 14, 2026 at 8:19 am
  • Editorial Team
    Editorial Team added an answer You can now download it for .NET 3.5SP1 and .NET… May 14, 2026 at 8:19 am
  • Editorial Team
    Editorial Team added an answer Unfortunately in the HTML5 canvas element you can't rotate individual… May 14, 2026 at 8:19 am

Related Questions

I am trying to compile the following very very simple piece of source code:
I am building a project in VS2005 and several of my DLLs are failing
I am encountering a weird error when using linq-to-sql with ado.net data services. I
I am using spring 2.5.6 and spring-integration 1.0.3 and MQ client 6.0.2.2 I have
I have recently started using Zend Framework. I started developing on my local XAMPP

Trending Tags

analytics british company computer developers django employee employer english facebook french google interview javascript language life php programmer programs salary

Top Members

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.