Library/Bullhorn/FastRest/Generator/ModelBuilder.php
private function buildEnumConstants() {
        foreach($this->getFields() as $field) {
            $options = $field->getEnumOptions();


            if(!is_null($options)) {
                $enumClass = new Object\Index($this->getConfiguration());
                $enumClass->setNamespace($this->getAbstractClass()->getNamespace().'\\'.$this->getAbstractClass()->getName());
                $enumClass->setName(ucfirst($field->getShortName()));
                $enumClass->addUse('Bullhorn\FastRest\Api\Services\SplEnum');
                $enumClass->setExtends('SplEnum');
                foreach($options as $option) {
                    $optionName = lcfirst($option);
                    if($optionName == '') {
                        $optionName = 'EMPTY';
                    }
                    $this->getAbstractClass()->addConstant($this->filterConstant($field->getShortName() . '_' . $optionName), $option);
                    $enumClass->addConstant($this->filterConstant($optionName), $option);
                }
                $enumClass->write();
            }
        }
    }
private function buildEnumConstants() {
        foreach($this->getFields() as $field) {
            $options = $field->getEnumOptions();


            if(!is_null($options)) {
                $enumClass = new Object\Index($this->getConfiguration());
                $enumClass->setNamespace($this->getAbstractClass()->getNamespace().'\\'.$this->getAbstractClass()->getName());
                $enumClass->setName(ucfirst($field->getShortName()));
                $enumClass->addUse('Bullhorn\FastRest\Api\Services\SplEnum');
                $enumClass->setExtends('SplEnum');
                foreach($options as $option) {
                    $optionName = lcfirst($option);
                    if($optionName == '') {
                        $optionName = 'EMPTY';
                    }
                    $this->getAbstractClass()->addConstant($this->filterConstant($field->getShortName() . '_' . $optionName), $option);
                    $enumClass->addConstant($this->filterConstant($optionName), $option);
                }
                $enumClass->write();
            }
        }
    }
private function buildEnumConstants ( ) { foreach ( $ this -> getFields ( ) as $ field ) { $ options = $ field -> getEnumOptions ( ) ; if ( ! is_null ( $ options ) ) { $ enumClass = new Object \ Index ( $ this -> getConfiguration ( ) ) ; $ enumClass -> setNamespace ( $ this -> getAbstractClass ( ) -> getNamespace ( ) . '\\' . $ this -> getAbstractClass ( ) -> getName ( ) ) ; $ enumClass -> setName ( ucfirst ( $ field -> getShortName ( ) ) ) ; $ enumClass -> addUse ( 'Bullhorn\FastRest\Api\Services\SplEnum' ) ; $ enumClass -> setExtends ( 'SplEnum' ) ; foreach ( $ options as $ option ) { $ optionName = lcfirst ( $ option ) ; if ( $ optionName == '' ) { $ optionName = 'EMPTY' ; } $ this -> getAbstractClass ( ) -> addConstant ( $ this -> filterConstant ( $ field -> getShortName ( ) . '_' . $ optionName ) , $ option ) ; $ enumClass -> addConstant ( $ this -> filterConstant ( $ optionName ) , $ option ) ; } $ enumClass -> write ( ) ; } } }
Builds the enum constants
@return void
@throws \Exception
Builds the enum constants