Tariqa  3.0
 All Data Structures Namespaces Files Functions Variables Enumerations
newsAdapter Class Reference

Public Member Functions

 __construct ($query, $config, $throw_errors=false)
 translate ()
 fetchNews ($fetch_type=self::FETCH_TEXTXML)
 fetchWebsite ($fetch_only_body=true)

Static Public Member Functions

static fetchArticle ($id, $newsConfig, $fetch_type=self::FETCH_DOMDOCUMENT)

Data Fields

const FETCH_DOMDOCUMENT = 'dom'
const FETCH_TEXTXML = 'txt'
const FETCH_OBJECT = 'obj'

Protected Member Functions

 hasAccess ($user_groups)

Detailed Description

Base class for fetching the news results from any engine and from any source

Author:
Cosmin Popescu

Constructor & Destructor Documentation

__construct ( query,
config,
throw_errors = false 
)

Constructs the news adapter

Parameters:
newsQuery$queryThe query
array$configThe config array
boolean$throw_errorsIf true, throw errors instead of returning a message [OPTIONAL] public
Returns:
void

Member Function Documentation

static fetchArticle ( id,
newsConfig,
fetch_type = self::FETCH_DOMDOCUMENT 
) [static]

Fetches one article

Parameters:
string$idThe document id
array$newsConfigThe news configuration array
string$fetch_typeSee the fetch constants [OPTIONAL] public
Returns:
string|DOMDocument|tariqaFullDocument
fetchNews ( fetch_type = self::FETCH_TEXTXML)

Fetches the news results

Parameters:
boolean$fetch_typeSee the fetch constants [OPTIONAL] public
Returns:
string|DOMDocument
fetchWebsite ( fetch_only_body = true)

Fetches a website content

Parameters:
boolean$fetch_only_bodyIf true, fetches only the body [OPTIONAL] public
Returns:
string
hasAccess ( user_groups) [protected]

Checks if an user has access rights

Parameters:
array$user_groupsAn array with the user groups protected
Returns:
boolean
translate ( )

Translate the query from unified query syntax to engine specific protected

Returns:
string

Field Documentation

const FETCH_DOMDOCUMENT = 'dom'
const FETCH_OBJECT = 'obj'
const FETCH_TEXTXML = 'txt'

The documentation for this class was generated from the following file: