private function getFormChoiceTextFunction()
    {

        // default function only works for tables with a lone primary key
        $columns = $this->pgClass->getAttributes();

        // find columns tagged 'form-choicetext'
        $columnsSelected = array();
        foreach( $columns as $column) {
            $tags = \Bond\extract_tags( $column, 'normality' );
            if( isset( $tags['form-choicetext']) ) {
                $columnsSelected[] = $column;
            }
        }

        switch( count($columnsSelected) ) {
            case 0:
                return;
            case 1:
                $columnName = array_pop( $columnsSelected )->name;
                break;
            default:
                throw new \FormChoiceTextConfigurationException( "Multiple columns with tag 'form-choicetext'. Only one column per table can have this tag." );
        }

        $this->class->classComponents[] = new FunctionDeclaration(
            'form_choiceText',
            new Sformatf( <<<'PHP'
                /**
                * Function called by \Bond\Bridge\Normality\Form\Type\Normality when displaying text for this entity
                * @return scalar
                */
                public function form_choiceText()
                {
                    return $this->get('%s');
                }
PHP
                , addslashes( $columnName )
            )
        );

    }
private function getFormChoiceTextFunction()
    {

        // default function only works for tables with a lone primary key
        $columns = $this->pgClass->getAttributes();

        // find columns tagged 'form-choicetext'
        $columnsSelected = array();
        foreach( $columns as $column) {
            $tags = \Bond\extract_tags( $column, 'normality' );
            if( isset( $tags['form-choicetext']) ) {
                $columnsSelected[] = $column;
            }
        }

        switch( count($columnsSelected) ) {
            case 0:
                return;
            case 1:
                $columnName = array_pop( $columnsSelected )->name;
                break;
            default:
                throw new \FormChoiceTextConfigurationException( "Multiple columns with tag 'form-choicetext'. Only one column per table can have this tag." );
        }

        $this->class->classComponents[] = new FunctionDeclaration(
            'form_choiceText',
            new Sformatf( <<<'PHP'
                /**
                * Function called by \Bond\Bridge\Normality\Form\Type\Normality when displaying text for this entity
                * @return scalar
                */
                public function form_choiceText()
                {
                    return $this->get('%s');
                }
PHP
                , addslashes( $columnName )
            )
        );

    }
private function getFormChoiceTextFunction ( ) { // default function only works for tables with a lone primary key $ columns = $ this -> pgClass -> getAttributes ( ) ; // find columns tagged 'form-choicetext' $ columnsSelected = array ( ) ; foreach ( $ columns as $ column ) { $ tags = \ Bond \ extract_tags ( $ column , 'normality' ) ; if ( isset ( $ tags [ 'form-choicetext' ] ) ) { $ columnsSelected [ ] = $ column ; } } switch ( count ( $ columnsSelected ) ) { case 0 : return ; case 1 : $ columnName = array_pop ( $ columnsSelected ) -> name ; break ; default : throw new \ FormChoiceTextConfigurationException ( "Multiple columns with tag 'form-choicetext'. Only one column per table can have this tag." ) ; } $ this -> class -> classComponents [ ] = new FunctionDeclaration ( 'form_choiceText' , new Sformatf (  <<<'PHP'
                /**
                * Function called by \Bond\Bridge\Normality\Form\Type\Normality when displaying text for this entity
                * @return scalar
                */
                public function form_choiceText()
                {
                    return $this->get('%s');
                }
PHP , addslashes ( $ columnName ) ) ) ; }
Form choice text function
@return array $lines
Form choice text function