Symfony\Component\Form\Form::isEmpty PHP Метод

isEmpty() публичный Метод

Returns whether the form is empty.
public isEmpty ( ) : boolean
Результат boolean
    public function isEmpty()
    {
        foreach ($this->children as $child) {
            if (!$child->isEmpty()) {

                return false;
            }
        }

        return array() === $this->appData || null === $this->appData || '' === $this->appData;
    }

Usage Example

Пример #1
0
 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());
 }
All Usage Examples Of Symfony\Component\Form\Form::isEmpty