isEmpty() public method

Returns whether the form is empty.
public isEmpty ( ) : boolean
return boolean
 public function testIsEmptyReturnsFalseIfAnyFieldIsFilled()
 {
     $form = new Form();
     $field1 = new TestField('foo');
     $field1->setData('baz');
     $field2 = new TestField('bar');
     $field2->setData(null);
     $form->add($field1);
     $form->add($field2);
     $this->assertFalse($form->isEmpty());
 }
Beispiel #2
0
 /**
  * {@inheritDoc}
  */
 public function isEmpty()
 {
     if ($this->mode === self::FORM) {
         return parent::isEmpty();
     }
     return Field::isEmpty();
 }