Mage_Adminhtml_Model_Search_Catalog Class Reference

Inheritance diagram for Mage_Adminhtml_Model_Search_Catalog:

Varien_Object

List of all members.

Public Member Functions

 load ()


Detailed Description

Definition at line 28 of file Catalog.php.


Member Function Documentation

load (  ) 

Definition at line 30 of file Catalog.php.

00031     {
00032         $arr = array();
00033 
00034         if (!$this->hasStart() || !$this->hasLimit() || !$this->hasQuery()) {
00035             $this->setResults($arr);
00036             return $this;
00037         }
00038 
00039         $collection = Mage::helper('catalogSearch')->getQuery()->getResultCollection()
00040             ->addAttributeToSelect('name')
00041             ->addAttributeToSelect('description')
00042             ->addSearchFilter($this->getQuery())
00043             ->setCurPage($this->getStart())
00044             ->setPageSize($this->getLimit())
00045             ->load();
00046 
00047         foreach ($collection as $product) {
00048             $arr[] = array(
00049                 'id'            => 'product/1/'.$product->getId(),
00050                 'type'          => 'Product',
00051                 'name'          => $product->getName(),
00052                 'description'   => Mage::helper('core/string')->substr($product->getDescription(), 0, 50),
00053                 'url'           => Mage::helper('adminhtml')->getUrl('*/catalog_product/edit', array('id'=>$product->getId())),
00054             );
00055         }
00056 
00057         $this->setResults($arr);
00058 
00059         return $this;
00060     }


The documentation for this class was generated from the following file:

Generated on Sat Jul 4 17:23:13 2009 for Magento by  doxygen 1.5.8