addElement('text', 'title', ['label' => 'Title', 'required' => true]); $this->addElement('text', 'symbol', ['label' => 'Symbol', 'required' => true, 'maxlength' => 16]); $unique = new Qs_Validate_Unique( new Qs_Db_Table('UtilityCategory'), 'symbol', Qs_Array::get($this->_primaryKey, 'id') ); $unique->setMessage('Symbol should be unique', Qs_Validate_Unique::NOT_UNIQUE); $this->symbol->addValidator($unique, true); $this->addElement('checkbox', 'enabled', ['label' => 'Show in Filter', 'decoration' => 'simple']); return $this; } }