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