Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- So sometimes $userID seems to be empty or something and I get memory usage to the point where the process dies.
- <?php
- $result = Mage::getModel('customer/customer')
- ->getCollection()
- ->addAttributeToSelect('alternative_id')
- ->addAttributeToFilter('alternative_id', $userID)
- ->load();
- if ($result->getSize() === 1) {
- return $result->getFirstItem();
- } else {
- return false;
- }
- Does this look better?
- <?php
- $result = Mage::getModel('customer/customer')
- ->getCollection()
- ->addAttributeToSelect('alternative_id')
- ->addAttributeToFilter('alternative_id', $userID)
- ->setPageSize(3) //added this
- ->setCurPage(1) //added this
- ->load();
- if ($result->getSize() === 1) {
- return $result->getFirstItem();
- } else {
- return false;
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement