University of Southern California

Public Member Functions

WSCORE2 Class Reference

Inheritance diagram for WSCORE2:
SOC_Cache2 SOC_Widget AIS_SOAP_WS SOC_API1C SOC_Configuration

List of all members.

Public Member Functions

 __construct ($conf=NULL)
 simpleConf ($configuration)
 getKeys ()
 set ($key, $value=NULL)
 get ($key)
 map ($src, $obj, $verbose=false)
 message ($msg=NULL)
 errorCount ()
 open ()
 release ()
 execute ($sql, $verbose=false)
 mapExecute ($sql, $obj, $verbose=false)
 getRow ($verbose=false)
 lastInsertRowId ()
 close ()

Detailed Description

WSCORE2 a root object for building MV* based applications

Definition at line 35 of file WSCORE2.php.


Constructor & Destructor Documentation

WSCORE2::__construct ( conf = NULL )

__construct: Constructor for WSCORE2 objects.

Parameters:
aWSCORE2 object or JSON string for attribute settings.

Reimplemented in SOC_API1C, and SOC_Cache2.

Definition at line 40 of file WSCORE2.php.

References message(), and simpleConf().

Referenced by SOC_Widget::SOC_Widget().


Member Function Documentation

WSCORE2::close (  )

close - Close the open database connection.

Returns:
true if successful, false otherwise.

Reimplemented in SOC_API1C.

Definition at line 427 of file WSCORE2.php.

References message().

WSCORE2::errorCount (  )

errorCount - count the number of error messages in message queue.

Returns:
error count from message queue.

Definition at line 197 of file WSCORE2.php.

Referenced by SOC_API1C::_restParse(), SOC_Cache2::createTables(), SOC_API1C::eventLoop(), SOC_API1C::getClasses(), SOC_Cache2::setCache(), simpleConf(), and AIS_SOAP_WS::xmlFromSoap().

WSCORE2::execute ( sql,
verbose = false 
)

execute - run an SQL query against the database.

Parameters:
$sql- SQL query to run.
$verbose- send more messages to message_queue if true.
Returns:
true if successful, false otherwise

Definition at line 305 of file WSCORE2.php.

References message().

Referenced by SOC_Cache2::createTables(), SOC_Cache2::listCache(), mapExecute(), and SOC_Cache2::setCache().

WSCORE2::get ( key )

get - return the value for a given key or false if not set.

Parameters:
$key- the key for the value to be retrieved.
Returns:
value if found, false otherwise.

Definition at line 134 of file WSCORE2.php.

Referenced by SOC_API1C::help(), and SOC_Configuration::SOC_Configuration().

WSCORE2::getKeys (  )

getKeys - return a list of attribute keys for object.

Returns:
array of keys, false otherwise.

Definition at line 107 of file WSCORE2.php.

WSCORE2::getRow ( verbose = false )

getRow - get a row from a query result

Parameters:
$verbose- send more messages to the message queue.
Returns:
an associative array of the row or false if no row available.

Definition at line 375 of file WSCORE2.php.

References message().

Referenced by SOC_Cache2::getCache(), and SOC_Cache2::listCache().

WSCORE2::lastInsertRowId (  )

lastInsertRowId - get the id of the last inserted row.

Returns:
the row if or false

Definition at line 406 of file WSCORE2.php.

References message().

WSCORE2::map ( src,
obj,
verbose = false 
)

map - map an object's key/value pairs into a template string.

Parameters:
$src- the template to use.
$obj- the data to map into the template.
$verbose- if true send more messages to message queue.
Returns:
the mapped string or false if a problem is unresolved.

Definition at line 148 of file WSCORE2.php.

References message().

Referenced by mapExecute().

WSCORE2::mapExecute ( sql,
obj,
verbose = false 
)

mapExecute - map an object into a SQL template and run query.

Parameters:
$sql- SQL template.
$obj- Object to map into SQL template.
$verbose- send more messages to message_queue if true.
Returns:
true if successful, false otherwise

Definition at line 362 of file WSCORE2.php.

References execute(), and map().

Referenced by SOC_Cache2::getCache().

WSCORE2::message ( msg = NULL )

message - add a message to the queue or return the entire queue contents and flush the queue.

Parameters:
$msg- add message to queue of if NULL return queue.
Returns:
true if successfully adding content, A string representation of queue if $msg === NULL, false otherwise.

Definition at line 182 of file WSCORE2.php.

Referenced by __construct(), close(), SOC_Cache2::createTables(), SOC_Widget::error(), SOC_Widget::errors(), execute(), getRow(), lastInsertRowId(), map(), open(), release(), SOC_Cache2::setCache(), and simpleConf().

WSCORE2::open (  )

open - open a database connection.

Definition at line 210 of file WSCORE2.php.

References message().

WSCORE2::release (  )

free - free the memory from a SQL query result. Currently only works with MySQL using mysql_free_result

Returns:
true on success, false if an error is encountered.

Definition at line 270 of file WSCORE2.php.

References message().

Referenced by SOC_Cache2::getCache(), and SOC_Cache2::listCache().

WSCORE2::set ( key,
value = NULL 
)

set - set a key/value pair as an attribute.

Parameters:
$key- unique key for key/value pair
$value- value to be set or NULL, if NULL then key/value pair will be removed from attributes if exists.
Returns:
true on success, false otherwise.

Definition at line 120 of file WSCORE2.php.

Referenced by SOC_Configuration::SOC_Configuration().

WSCORE2::simpleConf ( configuration )

simpleConf - read a string which is a colon delimited set of key/value pairs, with one line per pair and where # delimits comments

Parameters:
conf- A configuration file's content as string (i.e. what you would get from get_file_contents())
Returns:
true if successfully read the file, false otherwise.

Definition at line 79 of file WSCORE2.php.

References errorCount(), and message().

Referenced by __construct().


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