Файл: _rootinc/cnic/Response/Search.php
Строк: 27
<?
// CNic_Toolkit_Response_Search - response object for searches
// Copyright (c) 2010 CentralNic Ltd. All rights reserved. This program is
// free software; you can redistribute it and/or modify it under the terms
// of the GNU GPL
// $Id: Search.php,v 1.8 2010/03/31 12:03:03 gavin Exp $
class CNic_Toolkit_Response_Search extends CNic_Toolkit_Response {
public function is_registered($suffix) {
foreach ($this->keys() as $key) {
if (preg_match("/$suffix$/i", $key)) {
$data = $this->response($key);
return ($data[0] == 1 ? true : false);
}
}
return false;
}
public function registrant($suffix) {
foreach ($this->keys() as $key) {
if (preg_match("/$suffix$/i", $key)) {
$data = $this->response($key);
return $data[1];
}
}
return false;
}
public function expiry($suffix) {
foreach ($this->keys() as $key) {
if (preg_match("/$suffix$/i", $key)) {
$data = $this->response($key);
return $data[2];
}
}
return false;
}
}
?>