src/Validation/Validation.php
private function getElements($annotations, $formClass)
    {
        $labels = $this->getLabels($annotations);
        $reflection = new \ReflectionClass($formClass);
        $defaultValues = $reflection->getDefaultProperties();

        $elements = [];
        $it = $this->getAnnotations()->filter($annotations)
            ->is(InputInterface::class)
            ->onProperties();
        foreach ($it as $annotation) {
            $property = $annotation->getPropertyName();
            if (!isset($annotation->name)) {
                $annotation->name = $property;
            }
            $elem = $annotation->getElement($this);
            if ($annotation->label) {
                $label = $annotation->label;
            } elseif (isset($labels[$property])) {
                $label = $labels[$property];
            } else {
                $label = str_replace('_', ' ', ucfirst($property));
            }
            $elem->setLabel($label);
            if (isset($defaultValues[$property])) {
                $elem->setDefault($defaultValues[$property]);
            }
            $elements[$property] = $elem;
        }
        return $elements;
    }
private function getElements($annotations, $formClass)
    {
        $labels = $this->getLabels($annotations);
        $reflection = new \ReflectionClass($formClass);
        $defaultValues = $reflection->getDefaultProperties();

        $elements = [];
        $it = $this->getAnnotations()->filter($annotations)
            ->is(InputInterface::class)
            ->onProperties();
        foreach ($it as $annotation) {
            $property = $annotation->getPropertyName();
            if (!isset($annotation->name)) {
                $annotation->name = $property;
            }
            $elem = $annotation->getElement($this);
            if ($annotation->label) {
                $label = $annotation->label;
            } elseif (isset($labels[$property])) {
                $label = $labels[$property];
            } else {
                $label = str_replace('_', ' ', ucfirst($property));
            }
            $elem->setLabel($label);
            if (isset($defaultValues[$property])) {
                $elem->setDefault($defaultValues[$property]);
            }
            $elements[$property] = $elem;
        }
        return $elements;
    }
private function getElements ( $ annotations , $ formClass ) { $ labels = $ this -> getLabels ( $ annotations ) ; $ reflection = new \ ReflectionClass ( $ formClass ) ; $ defaultValues = $ reflection -> getDefaultProperties ( ) ; $ elements = [ ] ; $ it = $ this -> getAnnotations ( ) -> filter ( $ annotations ) -> is ( InputInterface :: class ) -> onProperties ( ) ; foreach ( $ it as $ annotation ) { $ property = $ annotation -> getPropertyName ( ) ; if ( ! isset ( $ annotation -> name ) ) { $ annotation -> name = $ property ; } $ elem = $ annotation -> getElement ( $ this ) ; if ( $ annotation -> label ) { $ label = $ annotation -> label ; } elseif ( isset ( $ labels [ $ property ] ) ) { $ label = $ labels [ $ property ] ; } else { $ label = str_replace ( '_' , ' ' , ucfirst ( $ property ) ) ; } $ elem -> setLabel ( $ label ) ; if ( isset ( $ defaultValues [ $ property ] ) ) { $ elem -> setDefault ( $ defaultValues [ $ property ] ) ; } $ elements [ $ property ] = $ elem ; } return $ elements ; }
Gets all form elements

@return array key is property, value is Phalcon\Form\Element object
Gets all form elements