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