_type; } protected function setType($type) { $this->_type = $type; return $this; } protected function _initElements() { $type = $this->getType(); switch ($type) { case AbstractObj::TYPE_FOR_SALE : $this->_initForSaleElements(); break; case AbstractObj::TYPE_WANTED : $this->_initWantedElements(); break; case AbstractObj::TYPE_HELP_WANTED : $this->_initHelpWantedElements(); break; case AbstractObj::TYPE_OTHER : $this->_initOtherElements(); break; default: $this->_initForSaleElements(); $type = AbstractObj::TYPE_FOR_SALE; break; } $this->addElement('hidden', 'type', ['value' => $type]); return parent::_initElements(); } }