|
Server IP : 10.2.73.233 / Your IP : 216.73.216.59 Web Server : Apache/2.4.59 (Debian) System : Linux polon 4.19.0-27-amd64 #1 SMP Debian 4.19.316-1 (2024-06-25) x86_64 User : www-data ( 33) PHP Version : 5.6.40-64+0~20230107.71+debian10~1.gbp673146 Disable Function : pcntl_alarm,pcntl_fork,pcntl_waitpid,pcntl_wait,pcntl_wifexited,pcntl_wifstopped,pcntl_wifsignaled,pcntl_wexitstatus,pcntl_wtermsig,pcntl_wstopsig,pcntl_signal,pcntl_signal_dispatch,pcntl_get_last_error,pcntl_strerror,pcntl_sigprocmask,pcntl_sigwaitinfo,pcntl_sigtimedwait,pcntl_exec,pcntl_getpriority,pcntl_setpriority, MySQL : ON | cURL : ON | WGET : ON | Perl : ON | Python : ON Directory (0755) : /home/leksykografia/application/models/ |
| [ Home ] | [ C0mmand ] | [ Upload File ] |
|---|
<?php
class Application_Model_Vote
{
protected $_id;
protected $_page;
protected $_point1;
protected $_point2;
protected $_point3;
protected $_point4;
protected $_point5;
protected $_active;
public function __construct(array $options = null)
{
if (is_array($options)) {
$this->setOptions($options);
}
}
public function __set($name, $value)
{
$method = 'set' . $name;
if (('mapper' == $name) || !method_exists($this, $method)) {
throw new Exception('Invalid page property');
}
$this->$method($value);
}
public function __get($name)
{
$method = 'get' . $name;
if (('mapper' == $name) || !method_exists($this, $method)) {
throw new Exception('Invalid page property');
}
return $this->$method();
}
public function setOptions(array $options)
{
$methods = get_class_methods($this);
foreach ($options as $key => $value) {
$method = 'set' . ucfirst($key);
if (in_array($method, $methods)) {
$this->$method($value);
}
}
return $this;
}
public function getOptions()
{
$vars = get_class_vars('Application_Model_Vote');
$data = array();
foreach ($vars as $key => $value) {
$data[ltrim($key,'_')] = $this->$key;
}
return $data;
}
public function setPage($id)
{
$this->_page = $id;
return $this;
}
public function getPage()
{
return $this->_page;
}
public function setPoint1($point)
{
$this->_point1 = $point;
return $this;
}
public function getPoint1()
{
return $this->_point1;
}
public function setPoint2($point)
{
$this->_point2 = $point;
return $this;
}
public function getPoint2()
{
return $this->_point2;
}
public function setPoint3($point)
{
$this->_point3 = $point;
return $this;
}
public function getPoint3()
{
return $this->_point3;
}
public function setPoint4($point)
{
$this->_point4 = $point;
return $this;
}
public function getPoint4()
{
return $this->_point4;
}
public function setPoint5($point)
{
$this->_point5 = $point;
return $this;
}
public function getPoint5()
{
return $this->_point5;
}
public function setActive($active)
{
$this->_active = $active;
return $this;
}
public function getActive()
{
return $this->_active;
}
public function setId($id)
{
$this->_id = (int) $id;
return $this;
}
public function getId()
{
return $this->_id;
}
}