Created
February 20, 2013 18:23
-
-
Save Schrank/4997757 to your computer and use it in GitHub Desktop.
Check wether a collection should load an attribute
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
class Observer { | |
protected function _collectionShouldLoadWidthAndHeight(Mage_Catalog_Model_Resource_Product_Collection $collection) | |
{ | |
$reflection = new ReflectionProperty($collection, '_selectAttributes'); | |
$reflection->setAccessible(true); | |
$value = $reflection->getValue($collection); | |
return array_key_exists('original_height', $value) || array_key_exists('original_width', $value); | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment