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
0
 /**
  * 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
0
	/**
	 * @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
0
	/**
	 * 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
0
 /**
  * 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
0
 /**
  * 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
0
 /**
  * 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);
 }