Example #1
0
 /**
  * Get Solr response data
  *
  * Includes a lazy loading mechanism: JSON body data is decoded on first use and then saved for reuse.
  *
  * @return array
  */
 public function getData()
 {
     if (null == $this->_data) {
         $this->_data = json_decode($this->_response->getBody(), true);
         if (null === $this->_data) {
             throw new Solarium_Exception('Solr JSON response could not be decoded');
         }
     }
     return $this->_data;
 }
 public function testGetBody()
 {
     $this->assertEquals($this->_data, $this->_response->getBody());
 }