19:08
Этот коммит содержится в:
@@ -8,36 +8,139 @@
|
||||
|
||||
namespace PTEST\M;
|
||||
|
||||
use PFRM\Model;
|
||||
|
||||
class AdModel {
|
||||
class AdModel extends Model{
|
||||
|
||||
protected $id;
|
||||
protected $table_id;
|
||||
|
||||
protected $username;
|
||||
protected $table_username;
|
||||
|
||||
protected $email;
|
||||
protected $table_email;
|
||||
|
||||
protected $ip;
|
||||
protected $table_homepage;
|
||||
|
||||
protected $browser;
|
||||
protected $table_ip;
|
||||
|
||||
protected $text;
|
||||
protected $table_browser;
|
||||
|
||||
protected $date;
|
||||
protected $table_ptext;
|
||||
|
||||
function __construct() {
|
||||
}
|
||||
|
||||
public function setUserName() {
|
||||
protected $table_pdate;
|
||||
|
||||
/**
|
||||
* @param $username
|
||||
*
|
||||
* @return bool|string
|
||||
*/
|
||||
public function setUserName( $username ) {
|
||||
if ( preg_match( '/[a-z,\d]{3,}/i', $username ) ) {
|
||||
$this->table_username = $username;
|
||||
return true;
|
||||
} else {
|
||||
return "Только цифры и буквы латинского алфавита, минимум 3";
|
||||
}
|
||||
}
|
||||
|
||||
public function getUserName(){
|
||||
return $this->username;
|
||||
return $this->table_username;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $email
|
||||
*
|
||||
* @return bool|string
|
||||
*/
|
||||
public function setEmail( $email ) {
|
||||
if ( preg_match('/.+@.+\..+/i', $email ) ) {
|
||||
$this->table_email = $email;
|
||||
return true;
|
||||
} else {
|
||||
return "Введите коректный e-mail адрес";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getEmail() {
|
||||
return $this->email;
|
||||
return $this->table_email;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $homepage
|
||||
*
|
||||
* @return bool|string
|
||||
*/
|
||||
public function setHomepage( $homepage ) {
|
||||
if ( preg_match('|https?://.*\..*|i', $homepage ) ) {
|
||||
$this->table_homepage = $homepage;
|
||||
return true;
|
||||
} else {
|
||||
return "Введите коректный адрес";
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getHomepage() {
|
||||
return $this->table_homepage;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $ip
|
||||
*/
|
||||
public function setIp( $ip ) {
|
||||
$this->table_ip = $ip;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getIp() {
|
||||
return $this->table_ip;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $browser
|
||||
*/
|
||||
public function setBrowser( $browser ) {
|
||||
$this->table_browser = $browser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getBrowser() {
|
||||
return $this->table_browser;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $text
|
||||
*/
|
||||
public function setText( $text ) {
|
||||
$this->table_ptext = strip_tags($text);
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getText() {
|
||||
return $this->table_ptext;
|
||||
}
|
||||
|
||||
/**
|
||||
* @param mixed $date
|
||||
*/
|
||||
public function setDate( $date ) {
|
||||
$this->table_pdate = $date;
|
||||
}
|
||||
|
||||
/**
|
||||
* @return mixed
|
||||
*/
|
||||
public function getDate() {
|
||||
return $this->table_pdate;
|
||||
}
|
||||
}
|
Ссылка в новой задаче
Block a user