Собственно вопрос, как с этим бороться и надо ли? Магические методы может в таком случае надо юзать?
Еще узнал после того как вручную все написал, что нетбинс сам генерит сеттеры и геттеры )
class Element {
private $_sField;
private $_sLabel = '';
private $_sType = 'text';
private $_sName = '';
private $_sValue = '';
private $_aOption = array();
private $_aRule = array();
private $_sClassName = '';
private $_sIdName = '';
private $_sComment = '';
private $aKnownType = array('input', 'select', 'textarea');
function __construct($sField = '') {
if (!$sField)
throw new esyFormExeption ('Element: Not specified the element type');
if (!in_array($sField, $this->aKnownType))
throw new esyFormExeption ('Element: Unknown entry type');
$this->_sField = $sField;
return $this;
}
public function setType($sType) {
$this->_sType = $sType;
return $this;
}
public function setName($sName = '') {
$this->_sName = $sName;
return $this;
}
public function setValue($sValue = '') {
$this->_sValue = $sValue;
return $this;
}
public function setRule($aRule = array()) {
$this->_aRule = $aRule;
return $this;
}
public function setClassName($sClassName) {
$this->_sClassName = $sClassName;
return $this;
}
public function setIdName($sIdName) {
$this->_sIdName = $sIdName;
return $this;
}
public function setLabel($sLabel) {
$this->_sLabel = $sLabel;
return $this;
}
public function setComment($sComment) {
$this->_sComment = $sComment;
return $this;
}
public function setOption($aOption) {
$this->_aOption = $aOption;
return $this;
}
public function getType() {
return $this->_sType;
}
public function getField() {
return $this->_sField;
}
public function getName() {
return $this->_sName;
}
public function getValue() {
return $this->_sValue;
}
public function getRule() {
return $this->_aRule;
}
public function getClassName() {
return $this->_sClassName;
}
public function getIdName() {
return $this->_sIdName;
}
public function getLabel() {
return $this->_sLabel;
}
public function getComment() {
return $this->_sComment;
}
public function render() {
return Render::Element($this);
}
}