/** * Retrieve a single object by pkey. * * @param int $pk the primary key. * @param PropelPDO $con the connection to use * @return comment */ public static function retrieveByPK($pk, PropelPDO $con = null) { if (null !== ($obj = commentPeer::getInstanceFromPool((string) $pk))) { return $obj; } $criteria = new Criteria(commentPeer::DATABASE_NAME); $criteria->add(commentPeer::ID, $pk); $v = commentPeer::doSelect($criteria, $con); return !empty($v) > 0 ? $v[0] : null; }