src/Schema.php
public function getSuggestionFormat(array $data)
    {
        //if no suggestion format
        if (!isset($this->data['suggestion']) || !trim($this->data['suggestion'])) {
            //use best guess
            $suggestion = null;
            foreach ($data as $key => $value) {
                if (is_numeric($value)
                    || (
                        isset($value[0])
                        && is_numeric($value[0])
                    )
                ) {
                    continue;
                }

                $suggestion = $value;
                break;
            }

            //if still no suggestion
            if (is_null($suggestion)) {
                //just get the first one, i guess.
                foreach ($data as $key => $value) {
                    $suggestion = $value;
                    break;
                }
            }

            return $suggestion;
        }

        $template = cradle('global')->handlebars()->compile($this->data['suggestion']);

        return $template($data);
    }
public function getSuggestionFormat(array $data)
    {
        //if no suggestion format
        if (!isset($this->data['suggestion']) || !trim($this->data['suggestion'])) {
            //use best guess
            $suggestion = null;
            foreach ($data as $key => $value) {
                if (is_numeric($value)
                    || (
                        isset($value[0])
                        && is_numeric($value[0])
                    )
                ) {
                    continue;
                }

                $suggestion = $value;
                break;
            }

            //if still no suggestion
            if (is_null($suggestion)) {
                //just get the first one, i guess.
                foreach ($data as $key => $value) {
                    $suggestion = $value;
                    break;
                }
            }

            return $suggestion;
        }

        $template = cradle('global')->handlebars()->compile($this->data['suggestion']);

        return $template($data);
    }
public function getSuggestionFormat ( array $ data ) { //if no suggestion format if ( ! isset ( $ this -> data [ 'suggestion' ] ) || ! trim ( $ this -> data [ 'suggestion' ] ) ) { //use best guess $ suggestion = null ; foreach ( $ data as $ key => $ value ) { if ( is_numeric ( $ value ) || ( isset ( $ value [ 0 ] ) && is_numeric ( $ value [ 0 ] ) ) ) { continue ; } $ suggestion = $ value ; break ; } //if still no suggestion if ( is_null ( $ suggestion ) ) { //just get the first one, i guess. foreach ( $ data as $ key => $ value ) { $ suggestion = $ value ; break ; } } return $ suggestion ; } $ template = cradle ( 'global' ) -> handlebars ( ) -> compile ( $ this -> data [ 'suggestion' ] ) ; return $ template ( $ data ) ; }
Based on the data will generate a suggestion format

@param array

@return string
Based on the data will generate a suggestion format