protected function addRetrieveByPK_SinglePK(&$script)
    {
        $table = $this->getTable();
        $pks = $table->getPrimaryKey();
        $col = $pks[0];

        $script .= "
    /**
     * Retrieve a single object by pkey.
     *
     * @param " . $col->getPhpType() . " \$pk the primary key.
     * @param      PropelPDO \$con the connection to use
     * @return " . $this->getObjectClassname() . "
     */
    public static function " . $this->getRetrieveMethodName() . "(\$pk, PropelPDO \$con = null)
    {

        if (null !== (\$obj = " . $this->getPeerClassname() . "::getInstanceFromPool(" . $this->getInstancePoolKeySnippet('$pk') . "))) {
            return \$obj;
        }

        if (\$con === null) {
            \$con = Propel::getConnection(" . $this->getPeerClassname() . "::DATABASE_NAME, Propel::CONNECTION_READ);
        }

        \$criteria = new Criteria(" . $this->getPeerClassname() . "::DATABASE_NAME);
        \$criteria->add(" . $this->getColumnConstant($col) . ", \$pk);

        \$v = " . $this->getPeerClassname() . "::doSelect(\$criteria, \$con);

        return !empty(\$v) > 0 ? \$v[0] : null;
    }
";
    }
protected function addRetrieveByPK_SinglePK(&$script)
    {
        $table = $this->getTable();
        $pks = $table->getPrimaryKey();
        $col = $pks[0];

        $script .= "
    /**
     * Retrieve a single object by pkey.
     *
     * @param " . $col->getPhpType() . " \$pk the primary key.
     * @param      PropelPDO \$con the connection to use
     * @return " . $this->getObjectClassname() . "
     */
    public static function " . $this->getRetrieveMethodName() . "(\$pk, PropelPDO \$con = null)
    {

        if (null !== (\$obj = " . $this->getPeerClassname() . "::getInstanceFromPool(" . $this->getInstancePoolKeySnippet('$pk') . "))) {
            return \$obj;
        }

        if (\$con === null) {
            \$con = Propel::getConnection(" . $this->getPeerClassname() . "::DATABASE_NAME, Propel::CONNECTION_READ);
        }

        \$criteria = new Criteria(" . $this->getPeerClassname() . "::DATABASE_NAME);
        \$criteria->add(" . $this->getColumnConstant($col) . ", \$pk);

        \$v = " . $this->getPeerClassname() . "::doSelect(\$criteria, \$con);

        return !empty(\$v) > 0 ? \$v[0] : null;
    }
";
    }
protected function addRetrieveByPK_SinglePK ( & $ script ) { $ table = $ this -> getTable ( ) ; $ pks = $ table -> getPrimaryKey ( ) ; $ col = $ pks [ 0 ] ; $ script .= "
    /**
     * Retrieve a single object by pkey.
     *
     * @param " . $ col -> getPhpType ( ) . " \$pk the primary key.
     * @param      PropelPDO \$con the connection to use
     * @return " . $ this -> getObjectClassname ( ) . "
     */
    public static function " . $ this -> getRetrieveMethodName ( ) . "(\$pk, PropelPDO \$con = null)
    {

        if (null !== (\$obj = " . $ this -> getPeerClassname ( ) . "::getInstanceFromPool(" . $ this -> getInstancePoolKeySnippet ( '$pk' ) . "))) {
            return \$obj;
        }

        if (\$con === null) {
            \$con = Propel::getConnection(" . $ this -> getPeerClassname ( ) . "::DATABASE_NAME, Propel::CONNECTION_READ);
        }

        \$criteria = new Criteria(" . $ this -> getPeerClassname ( ) . "::DATABASE_NAME);
        \$criteria->add(" . $ this -> getColumnConstant ( $ col ) . ", \$pk);

        \$v = " . $ this -> getPeerClassname ( ) . "::doSelect(\$criteria, \$con);

        return !empty(\$v) > 0 ? \$v[0] : null;
    }
" ; }
Adds the retrieveByPK method for tables with single-column primary key.

@param string &$script The script will be modified in this method.
Adds the retrieveByPK method for tables with single - column primary key .