This one has bugged me just enough to post this.. So imagine we are getting a row from the database on a custom table like so:

$row = $this->getCollection()->addFilter('quote_id', 1)->setPageSize(1)->getFirstItem();

This is all okay - and I can pull through the entire array using:


Which produces:

Array ( [entry_id] => 15 [quote_id] => 1 [custom_column] => it works [created_time] => 2014-02-05 21:10:53 )

I can even get a single column by passing the column as a parameter:


But here comes the weird part for me - when I try to do this using the other technique - it cannot pull it through:

$row->getCustomColumn(); // DOESN'T WORK

Now this is strange seeing as I can pull through other columns:

$row->getEntryId(); // works - where is the logic?

Can anyone shed light on why this is? Or if the answer is out there please reference it by all means. Thanks

  • 4
    Maybe getCustomColumn() is actual method of $row model. – mageUz Feb 5 '14 at 22:31
  • 1
    @jesusg_forceHarris. I'm not tagging. Just editing the content to make it look better. If you don't like it, flag any of my answers or questions, select the reason 'Custom' and explain to a moderator what the problem is. They will take actions against me if needed. – Marius Feb 6 '14 at 9:23
  • 2
    I will leave your content as you put it when you stop signing your posts: meta.stackexchange.com/a/5038/224252 and when you stop adding ** at the end of your questions. And as far as "going to the teacher"... The moderators are not teachers. they are here to make everything run smoothly. I really encourage you notify them whenever you see something that you think is wrong on this website. – Marius Feb 6 '14 at 9:39
  • 1
    @jesusg_forceHarris what is the type $row? – David Manners May 21 '14 at 10:23
  • 1
    jesusg_forceHarris: Take a look at @Marius's stats, history, and body of work here & let me know if you really think he "doesn't contribute anything". – benmarks Jul 7 '14 at 2:02

Probably getCustomColumn() is a real method of your model.

| improve this answer | |

The problem behind this is likely due to the fact that the attribute itself is not used in the product listing:

Catalog/Attributes/Manage Attributes and select your attribute, make sure that Used in Product Listing is set to yes. Then run a reindex & cache refresh and you should be able to call it like you're currently trying to do.

| improve this answer | |
  • They're not product attributes that I am trying to get. These are custom columns in a custom table_g – jesus g_force Harris Feb 6 '14 at 10:55
  • my mistake, whoops. – Moose Feb 6 '14 at 11:01

Not the answer you're looking for? Browse other questions tagged or ask your own question.