public function __construct() { // id $id = new Id('id'); $id->setRequired(true); $this->add($id); // name $name = new Text('name', 0, 250); $name->setRequired(false); $this->add($name); // type $type = new Int('type'); $type->setRequired(false); $this->add($type); }
public function __construct() { // id $id = new Id('id'); $id->setRequired(false); $this->add($id); // name $name = new Text('name', 1, 60); $name->setRequired(false); $this->add($name); // value $value = new Text('value', 1, 255); $value->setRequired(false); $this->add($value); }
public function __construct(WordKey $wordKeyElement) { // id $id = new Id('id'); $id->setRequired(true); $this->add($id); // langId $langId = new Id('langId'); $langId->setRequired(true); $this->add($langId); // key $this->add($wordKeyElement); // translate $translate = new Text('translate', 1, 500); $translate->setRequired(true); $translate->getFilterChain()->attachByName('StringTrim'); $this->add($translate); }
public function testIsValid() { $id = new Id(); $id->setValue(0); $this->assertFalse($id->isValid()); }