本文整理汇总了PHP中DatabaseObject::Search方法的典型用法代码示例。如果您正苦于以下问题:PHP DatabaseObject::Search方法的具体用法?PHP DatabaseObject::Search怎么用?PHP DatabaseObject::Search使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类DatabaseObject
的用法示例。
在下文中一共展示了DatabaseObject::Search方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: GetSubscriptionDefaultTimes
public static function GetSubscriptionDefaultTimes($p_countryCode = null,
$p_publicationId = null)
{
$constraints = array();
if (!is_null($p_countryCode)) {
$constraints[] = array('CountryCode', $p_countryCode);
}
if (!is_null($p_publicationId)) {
$constraints[] = array('IdPublication', $p_publicationId);
}
return DatabaseObject::Search('SubscriptionDefaultTime', $constraints);
}
示例2: GetBiographies
/**
* Get the author biography.
* Biography is returned in the given language if exists.
* If not any specific language is given it returns all the available translations.
*
* @param int $p_authorId
* @param string $p_languageId
* @return array
*/
public static function GetBiographies($p_authorId, $p_languageId = null)
{
$constraints = array();
if (!is_null($p_authorId)) {
$constraints[] = array("fk_author_id", $p_authorId);
}
if (!is_null($p_languageId)) {
$constraints[] = array("fk_language_id", $p_languageId);
}
return DatabaseObject::Search('AuthorBiographies', $constraints);
}
示例3: GetCountries
/**
* @param int $p_languageId
* @param string $p_code
* @param string $p_name
* @param array $p_sqlOptions
* @return array
*/
public static function GetCountries($p_languageId = null, $p_code = null,
$p_name = null, $p_sqlOptions = null)
{
if (is_null($p_sqlOptions)) {
$p_sqlOptions = array();
}
if (!isset($p_sqlOptions["ORDER BY"])) {
$p_sqlOptions["ORDER BY"] = array("Code", "IdLanguage");
}
$constraints = array();
if (!is_null($p_languageId)) {
$constraints[] = array('IdLanguage', $p_languageId);
}
if (!is_null($p_code)) {
$constraints[] = array('Code', $p_code);
}
if (!is_null($p_name)) {
$constraints[] = array('Name', $p_name);
}
return DatabaseObject::Search('Country', $constraints, $p_sqlOptions);
} // fn GetCountries
示例4: GetSections
/**
* Return an array of sections in the given issue.
* @param int $p_publicationId
* (Optional) Only return sections in this publication.
*
* @param int $p_issueNumber
* (Optional) Only return sections in this issue.
*
* @param int $p_languageId
* (Optional) Only return sections that have this language ID.
*
* @param string $p_urlName
* (Optional) Only return sections that have this URL name.
*
* @param string $p_sectionName
* (Optional) Only return sections that have this name.
*
* @param array $p_sqlOptions
* (Optional) Additional options. See DatabaseObject::ProcessOptions().
*
* @return array
*/
public static function GetSections($p_publicationId = null, $p_issueNumber = null,
$p_languageId = null, $p_urlName = null,
$p_sectionName = null, $p_sqlOptions = null, $p_skipCache = false)
{
if (!$p_skipCache && CampCache::IsEnabled()) {
$paramsArray['publication_id'] = (is_null($p_publicationId)) ? 'null' : $p_publicationId;
$paramsArray['issue_number'] = (is_null($p_issueNumber)) ? 'null' : $p_issueNumber;
$paramsArray['language_id'] = (is_null($p_languageId)) ? 'null' : $p_languageId;
$paramsArray['url_name'] = (is_null($p_urlName)) ? 'null' : $p_urlName;
$paramsArray['section_name'] = (is_null($p_sectionName)) ? 'null' : $p_sectionName;
$paramsArray['sql_options'] = (is_null($p_sqlOptions)) ? 'null' : $p_sqlOptions;
$cacheListObj = new CampCacheList($paramsArray, __METHOD__);
$sectionsList = $cacheListObj->fetchFromCache();
if ($sectionsList !== false && is_array($sectionsList)) {
return $sectionsList;
}
}
$constraints = array();
if (!is_null($p_publicationId)) {
$constraints[] = array("IdPublication", $p_publicationId);
}
if (!is_null($p_issueNumber)) {
$constraints[] = array("NrIssue", $p_issueNumber);
}
if (!is_null($p_languageId)) {
$constraints[] = array("IdLanguage", $p_languageId);
}
if (!is_null($p_urlName)) {
$constraints[] = array("ShortName", $p_urlName);
}
if (!is_null($p_sectionName)) {
$constraints[] = array("Name", $p_sectionName);
}
$sectionsList = DatabaseObject::Search('Section', $constraints, $p_sqlOptions);
if (!$p_skipCache && CampCache::IsEnabled()) {
$cacheListObj->storeInCache($sectionsList);
}
return $sectionsList;
} // fn GetSections
示例5: GetAuthorAliases
/**
* Get all the author aliases that match the given criteria.
*
* @param int $p_id
* @param int $p_authorId
* @param string $p_name
* @return array
*/
public static function GetAuthorAliases($p_id = null, $p_authorId = null, $p_name = null)
{
$constraints = array();
if (!is_null($p_authorId)) {
$constraints[] = array("fk_author_id", $p_authorId);
}
if (!is_null($p_name)) {
$constraints[] = array("alias", $p_name);
}
if (!is_null($p_id)) {
$constraints[] = array("id", $p_id);
}
return DatabaseObject::Search('AuthorAlias', $constraints);
} // fn GetAuthorAliases
示例6: GetAliases
/**
* Get all the aliases that match the given criteria.
*
* @param int $p_id
* @param int $p_publicationId
* @param string $p_name
* @return array
*/
public static function GetAliases($p_id = null, $p_publicationId = null, $p_name = null)
{
$contraints = array();
if (!is_null($p_publicationId)) {
$contraints[] = array("IdPublication", $p_publicationId);
}
if (!is_null($p_name)) {
$contraints[] = array("Name", $p_name);
}
if (!is_null($p_id)) {
$contraints[] = array("Id", $p_id);
}
return DatabaseObject::Search('Alias', $contraints);
}
示例7: GetSubscriptions
/**
* Fetch the subscription objects that match the search criteria.
*
* @param int $p_publicationId
* @param int $p_userId
* @param array $p_sqlOptions
* @return array
*/
public static function GetSubscriptions($p_publicationId = null, $p_userId = null, $p_sqlOptions = null)
{
$constraints = array();
if (!is_null($p_publicationId)) {
$constraints[] = array('IdPublication', $p_publicationId);
}
if (!is_null($p_userId)) {
$constraints[] = array('IdUser', $p_userId);
}
return DatabaseObject::Search('Subscription', $constraints, $p_sqlOptions);
}