本文整理匯總了PHP中ContentPeer::doSelect方法的典型用法代碼示例。如果您正苦於以下問題:PHP ContentPeer::doSelect方法的具體用法?PHP ContentPeer::doSelect怎麽用?PHP ContentPeer::doSelect使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類ContentPeer
的用法示例。
在下文中一共展示了ContentPeer::doSelect方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: retrieveByPKs
/**
* Retrieve multiple objects by pkey.
*
* @param array $pks List of primary keys
* @param PropelPDO $con the connection to use
* @throws PropelException Any exceptions caught during processing will be
* rethrown wrapped into a PropelException.
*/
public static function retrieveByPKs($pks, PropelPDO $con = null)
{
if ($con === null) {
$con = Propel::getConnection(ContentPeer::DATABASE_NAME, Propel::CONNECTION_READ);
}
$objs = null;
if (empty($pks)) {
$objs = array();
} else {
$criteria = new Criteria(ContentPeer::DATABASE_NAME);
$criteria->add(ContentPeer::ID, $pks, Criteria::IN);
$objs = ContentPeer::doSelect($criteria, $con);
}
return $objs;
}
示例2: retrieveByPK
/**
* Retrieve object using using composite pkey values.
* @param string $con_category
* @param string $con_parent
* @param string $con_id
* @param string $con_lang
* @param Connection $con
* @return Content
*/
public static function retrieveByPK($con_category, $con_parent, $con_id, $con_lang, $con = null)
{
if ($con === null) {
$con = Propel::getConnection(self::DATABASE_NAME);
}
$criteria = new Criteria();
$criteria->add(ContentPeer::CON_CATEGORY, $con_category);
$criteria->add(ContentPeer::CON_PARENT, $con_parent);
$criteria->add(ContentPeer::CON_ID, $con_id);
$criteria->add(ContentPeer::CON_LANG, $con_lang);
$v = ContentPeer::doSelect($criteria, $con);
return !empty($v) ? $v[0] : null;
}