private function getSqlInterfaceFunction()
    {

        if( count($this->keyProperties) !== 1 ) {

            $content = "    throw new \LogicException('Normality can\\'t (yet) handle tables without a primary key or multi-column primary keys.\\n".
                "Please extend the generator or overload {$this->pgClass->getEntityName()}->parse().');";

        } else {

            $primaryKey = $this->keyProperties[0];
            $dataType = $this->dataTypes[$primaryKey];

            // if datatype inheritied we don't need to do anything
            if( $dataType->isInherited() ) {
                return array();
            }

            // we're doing something
            $content = '';

            $this->class->addImplements( "SqlInterface");
            $this->class->addUses( 'Bond\Sql\QuoteInterface' );
            $this->class->addUses( 'Bond\Sql\SqlInterface' );

            if( $dataType->getType() === 'int' ) {

                // can this property be a entity?
                if( $dataType->isEntity() ) {
                    $content .= <<<PHP
    if( is_object( \$this->data['{$primaryKey}'] ) and \$this->data['{$primaryKey}'] instanceof SqlInterface ) {
        return \$this->data['{$primaryKey}']->parse( \$quoting );
    }\n
PHP
;
                }

                // cast integer datatype to int if not null
                $content .= <<<PHP
    return \$this->data['{$primaryKey}'] !== null ? (string) (int) \$this->data['{$primaryKey}'] : 'NULL';
PHP
;

            } else {

                $content .= <<<PHP
    return \$quoting->quote( \$this->data['{$primaryKey}'] );
PHP
;

            }

        }

        $fn = new Sformatf( <<<'PHP'
/**
 * Impementation of interface \Bond\Pg\Query->Validate()
 * @return scalar
 */
public function parse( QuoteInterface $quoting )
{
%s
}

PHP
            , $content
        );

        $this->class->classComponents[] = new FunctionDeclaration( "parse", $fn );

    }