コード例 #1
0
 /**
  * Load by IP
  *
  * @param Oggetto_GeoDetection_Model_Location $model Model
  * @param integer                             $ip    IP
  *
  * @return Oggetto_GeoDetection_Model_Location
  */
 public function loadByIp($model, $ip)
 {
     $select = $this->getReadConnection()->select()->from($this->getMainTable())->where('ip_from <= ?', $ip)->where('ip_to >= ?', $ip);
     $data = $this->getReadConnection()->fetchRow($select);
     if ($data) {
         $model->addData($data);
     }
     return $model;
 }
コード例 #2
0
 /**
  * Check resource model name
  *
  * @return void
  */
 public function testChecksResourceModelName()
 {
     $this->assertEquals('oggetto_geodetection/location', $this->_model->getResourceName());
 }