Comments: on this page. Click to read or post your own.

Class Object

Description

Base object that all others should inherit from.

This object provides a number of helper methods that patch over PHP's deficiencies.

Located in /sapphire/core/Object.php (line 9)


	
			
Direct descendents
Class Description
SearchContext Manages searching of properties on one or more DataObject types, based on a given set of input parameters.
SearchFilter
Filesystem A collection of static methods for manipulating the filesystem.
GD A wrapper class for GD-based images, with lots of manipulation functions.
Archive Class for handling archives.
ObjectTest_T1A Base object that all others should inherit from.
ObjectTest_T1B Base object that all others should inherit from.
ObjectTest_T1C Base object that all others should inherit from.
ObjectTest_T2 Base object that all others should inherit from.
ObjectTest_MyObject Base object that all others should inherit from.
i18nTestModule Base object that all others should inherit from.
i18nTestModule_Addition Base object that all others should inherit from.
i18nTestSubModule Base object that all others should inherit from.
i18nOtherModule Base object that all others should inherit from.
BasicAuth Provides an interface to HTTP basic authentication.
PasswordValidator This class represents a validator for member passwords.
Authenticator Abstract base class for an authentication method
CSVParser Class to handle parsing of CSV files, where the column headers are in the first row.
CSSContentParser CSSContentParser enables parsing & assertion running of HTML content via CSS selectors.
SSCli Class to facilitate command-line output.
BuildTask Interface for a generic build task. Does not support dependencies. This will simply run a chunk of code when called.
BulkLoader_Result Encapsulates the result of a BulkLoader import (usually through the BulkLoader->processAll() method).
Geoip Routines for DNS to country resolution
XML Base class for XML parsers
Form_FieldMap Base object that all others should inherit from.
FormScaffolder
FormTransformation This class represents "transformations" of a form - such as making it printable or making it readonly.
Validator This validation class handles all form and custom form validation through the use of Required fields.
ReportField_SimpleFilter Assisting class. Determines whether or not a column is hidden.
Extension Add extension that can be added to an object with Object::add_extension().
TokenisedRegularExpression A tokenised regular expression is a parser, similar to a regular expression, that acts on tokens rather than characters.
ViewableData Generic class for all data that will be accessed from a view.
i18n Base-class for storage and retrieval of translated entities.
i18nTextCollector
ArrayLib Library of static methods for manipulating arrays.
ValidationResult A class that combined as a boolean result with an optional list of error messages.
HTTPResponse Represenets an HTTPResponse returned by a controller.
HTTPRequest Represents a HTTP-request, including a URL that is tokenised for parsing, and a request method (GET/POST/PUT/DELETE).
SSViewer The SSViewer executes a .ss template file.
SQLMap This is a class used to represent key->value pairs generated from database queries.
SQLMap_Iterator Base object that all others should inherit from.
SQLQuery Object representing a SQL query.
DataObjectLog A DataObjectLog is a log of changes that have been made to the database in this session.
YamlFixture Uses the Spyc library to parse a YAML document (see http://yaml.org).
Database Abstract database connectivity class.
Query Abstract query-result class.
Convert Library of conversion functions, implemented as static methods.
Cookie A set of static methods for manipulating cookies.
Notifications The Notifications class allows you to create email notifications for various events.
Mailer Mailer objects are responsible for actually sending emails.
SQLFormatter Format a SQL Query for better readable output in HTML or Plaintext.
TextParser Parses text in a variety of ways.
DataFormatter A DataFormatter object handles transformation of data from Sapphire model objects to a particular output format, and vice versa.
SideReport Base object that all others should inherit from.
BatchProcess Create a process in session which is incremented to calls from the client
ShoppingCart The ShoppingCart class is a 'data handler' for the Order object.
Variable Summary
static mixed $builtInMethods
static mixed $classConstructed
static array $extensions
static mixed $extraMethods
static mixed $extraStatics
static mixed $statics
static mixed $static_cached
mixed $class
Method Summary
static void addStaticVars (string $class, array $statics, [boolean $replace = false])
static void add_extension ( $className,  $extensionName)
static void create (className $className, [args $arg0 = null], [ $arg1 = null], [ $arg2 = null], [ $arg3 = null], [ $arg4 = null], [ $arg5 = null], [ $arg6 = null], [ $arg7 = null], [ $arg8 = null])
static void getCustomClass ( $oldClass)
static void strong_create (className $className, [args $arg0 = null], [ $arg1 = null], [ $arg2 = null], [ $arg3 = null], [ $arg4 = null], [ $arg5 = null], [ $arg6 = null], [ $arg7 = null], [ $arg8 = null])
static void useCustomClass (oldClass $oldClass, customClass $customClass, [strong $strong = false])
Object __construct ()
void addMethodsFrom (parameterName $parameterName, [arrayIndex $arrayIndex = null])
void addWrapperMethod ( $methodName,  $wrapperMethod)
void allMethodNames ([ $includeCustom = false])
void buildMethodList ()
mixed cacheToFile (callback $callback, [int $expire = 3600], [string|int $id = false])
mixed cacheToFileWithArgs (callback $callback, [array $args = array()], [int $expire = 3600], [string|int $id = false])
void createMethod (methodName $methodName, methodCode $methodCode)
void defineMethods ()
void exists ()
void extend (string $funcName, [ &$arg = null], mixed $arg)
boolean hasExtension (string $requiredExtension)
void hasMethod ( $methodName)
void invokeWithExtensions (unknown_type $funcName, [unknown_type $arg = null])
void is_a ( $class)
mixed loadCache (string $cachename, [int $expire = 3600])
void parentClass ()
string sanitiseCachename (string $cachename)
void saveCache (string $cachename, mixed $data)
void set_stat ( $name,  $val)
void set_uninherited ( $name,  $val)
mixed stat (string $name, [boolean $uncached = false])
void uninherited ( $name, [ $builtIn = false])
void __call ( $methodName,  $args)
void __toString ()
Variables
static mixed $builtInMethods = array() (line 34)
  • access: protected
static mixed $classConstructed = array() (line 31)
  • access: protected
static array $extensions = null (line 28)

Extensions to be used on this object. An array of extension names and parameters eg:

static $extensions = array( "Hierarchy", "Versioned('Stage', 'Live')", );

  • access: public

Redefined in descendants as:
static mixed $extraMethods = array() (line 33)
  • access: protected
static mixed $extraStatics = array() (line 30)
  • access: protected
static mixed $statics = array() (line 346)
  • access: protected
static mixed $static_cached = array() (line 347)
  • access: protected
mixed $class (line 383)
  • access: public
array $extension_instances = array() (line 15)

This DataObjects extensions, eg Versioned.

  • access: protected
Methods
static method addStaticVars (line 292)

This method lets us extend a built-in class by adding pseudo-static variables to it.

static void addStaticVars (string $class, array $statics, [boolean $replace = false])
  • string $class: Classname
  • array $statics: Statics to add, with keys being static property names on the class
  • boolean $replace: Replace the whole variable instead of merging arrays
static method add_extension (line 469)

Add an extension to the given object.

This can be used to add extensions to built-in objects, such as role decorators on Member

  • access: public
static void add_extension ( $className,  $extensionName)
  • $className
  • $extensionName
static method create (line 95)

Create allows us to override the standard classes of sapphire with our own custom classes.

create will load strong classes firstly for singleton level and database interaction, otherwise will use the fallback custom classes. To set a strong custom class to overide an object at for say singleton use, use the syntax Object::useCustomClass('Datetime','SSDatetime',true);

  • access: public
static void create (className $className, [args $arg0 = null], [ $arg1 = null], [ $arg2 = null], [ $arg3 = null], [ $arg4 = null], [ $arg5 = null], [ $arg6 = null], [ $arg7 = null], [ $arg8 = null])
  • className $className: - The classname you want to create
  • args $arg0: - Up to 9 arguments you wish to pass on to the new class
  • $arg1
  • $arg2
  • $arg3
  • $arg4
  • $arg5
  • $arg6
  • $arg7
  • $arg8

Redefined in descendants as:
static method getCustomClass (line 78)
  • access: public
static void getCustomClass ( $oldClass)
  • $oldClass
static method strong_create (line 124)

Strong_create is a function to enforce a certain class replacement e.g Php5.2's latest introduction of a namespace conflict means we have to replace all instances of Datetime with SSdatetime.

this allows us to seperate those, and sapphires classes

  • access: public
static void strong_create (className $className, [args $arg0 = null], [ $arg1 = null], [ $arg2 = null], [ $arg3 = null], [ $arg4 = null], [ $arg5 = null], [ $arg6 = null], [ $arg7 = null], [ $arg8 = null])
  • className $className: - The class you wish to create.
  • args $arg0: - pass up to 8 arguments to the created class.
  • $arg1
  • $arg2
  • $arg3
  • $arg4
  • $arg5
  • $arg6
  • $arg7
  • $arg8
static method useCustomClass (line 70)

This function allows you to overload class creation methods, so certain classes are always created correctly over your system.

  • access: public
static void useCustomClass (oldClass $oldClass, customClass $customClass, [strong $strong = false])
  • oldClass $oldClass: = the old classname you want to replace with.
  • customClass $customClass: = the new Classname you wish to replace the old class with.
  • strong $strong: - If you want to force a replacement of a class then we use a different array e.g for use in singleton classes.
Constructor __construct (line 43)
Object __construct ()

Redefined in descendants as:
addMethodsFrom (line 207)

Add the all methods from a given parameter to this object.

This is used for extensions.

  • access: protected
void addMethodsFrom (parameterName $parameterName, [arrayIndex $arrayIndex = null])
  • parameterName $parameterName: The name of the parameter. This parameter must be instanciated with an item of the correct class.
  • arrayIndex $arrayIndex: If parameterName is an array, this can be an index. If null, we'll assume the value is all that is needed.
addWrapperMethod (line 223)

Add a 'wrapper method'.

For example, Thumbnail($arg, $arg) can be defined to call generateImage("Thumbnail", $arg, $arg)

  • access: protected
void addWrapperMethod ( $methodName,  $wrapperMethod)
  • $methodName
  • $wrapperMethod
allMethodNames (line 242)

Return the names of all the methods on this object.

param includeCustom If set to true, then return custom methods too.

void allMethodNames ([ $includeCustom = false])
  • $includeCustom
buildMethodList (line 254)
void buildMethodList ()
cacheToFile (line 534)

Caches the return value of a method.

  • return: The cached return of the method
  • access: public
mixed cacheToFile (callback $callback, [int $expire = 3600], [string|int $id = false])
  • callback $callback: The method to cache
  • int $expire: The lifetime of the cache
  • string|int $id: An id for the cache
cacheToFileWithArgs (line 569)

Caches the return value of a method. Passes args to the method as well.

  • return: The cached return of the method
  • access: public
mixed cacheToFileWithArgs (callback $callback, [array $args = array()], [int $expire = 3600], [string|int $id = false])
  • callback $callback: The method to cache
  • array $args: The arguments to pass to the method
  • int $expire: The lifetime of the cache
  • string|int $id: An id for the cache
createMethod (line 234)

Create a new method

  • access: protected
void createMethod (methodName $methodName, methodCode $methodCode)
  • methodName $methodName: The name of the method
  • methodCode $methodCode: The PHP code of the method, in a string. Arguments will be contained in an array called $args. The object will be $obj, not $this. You won't be able to access any protected methods; the method is actually contained in an external function.

Redefined in descendants as:
defineMethods (line 271)

This constructor will be called the first time an object of this class is created.

You can overload it with methods for setting up the class - for example, extra methods.

  • access: protected
void defineMethods ()

Redefined in descendants as:
exists (line 141)

Returns true if this object "exists", i.e., has a sensible value.

Overload this in subclasses. For example, an empty DataObject record could return false.

  • access: public
void exists ()

Redefined in descendants as:
extend (line 429)

Run the given function on all of this object's extensions. Note that this method originally returned void, so if you wanted to return results, you're hosed.

Currently returns an array, with an index resulting every time the function is called.

  • access: public
void extend (string $funcName, [ &$arg = null], mixed $arg)
  • string $funcName: The name of the function.
  • mixed $arg: An Argument to be passed to each of the extension functions.
  • &$arg
extInstance (line 448)

Get an extension on this DataObject

  • return: The instance of the extension
  • access: public
DataObjectDecorator extInstance (string $name)
  • string $name: Classname of the Extension (e.g. 'Versioned')
hasExtension (line 461)

Returns true if the given extension class is attached to this object

  • return: True if the given extension class is attached to this object
  • access: public
boolean hasExtension (string $requiredExtension)
  • string $requiredExtension: Classname of the extension
hasMethod (line 148)

Returns true if the given method exists.

  • access: public
void hasMethod ( $methodName)
  • $methodName

Redefined in descendants as:
invokeWithExtensions (line 407)

Invokes a method on the object itself, or proxied through a decorator.

This method breaks the normal rules of inheritance, and aggregates everything in the returned result. If the invoked methods return void, they are still recorded as empty array keys.

  • todo: find a better way of integrating inheritance rules
  • access: public
void invokeWithExtensions (unknown_type $funcName, [unknown_type $arg = null])
  • unknown_type $funcName
  • unknown_type $arg
is_a (line 308)
void is_a ( $class)
  • $class
loadCache (line 488)

Loads a current cache from the filesystem, if it can.

  • return: The data from the cache, or false if the cache wasn't loaded
  • access: protected
mixed loadCache (string $cachename, [int $expire = 3600])
  • string $cachename: The name of the cache to load
  • int $expire: The lifetime of the cache in seconds
parentClass (line 304)
void parentClass ()
sanitiseCachename (line 520)

Makes a cache name safe to use in a file system

  • return: the sanitised cache name
  • access: protected
string sanitiseCachename (string $cachename)
  • string $cachename: The cache name to sanitise
saveCache (line 503)

Saves a cache to the file system

  • access: protected
void saveCache (string $cachename, mixed $data)
  • string $cachename: The name of the cache to save
  • mixed $data: The data to cache
set_stat (line 378)

Set a static variable

void set_stat ( $name,  $val)
  • $name
  • $val
set_uninherited (line 315)

Set an uninherited static variable

void set_uninherited ( $name,  $val)
  • $name
  • $val
stat (line 356)

Get a static variable.

mixed stat (string $name, [boolean $uncached = false])
  • string $name
  • boolean $uncached
uninherited (line 322)

Get an uninherited static variable

void uninherited ( $name, [ $builtIn = false])
  • $name
  • $builtIn
__call (line 166)

Calls a method.

Extra methods can be hooked to a class using

  • access: public
void __call ( $methodName,  $args)
  • $methodName
  • $args

Redefined in descendants as:
__toString (line 386)
  • access: public
void __toString ()

Redefined in descendants as:
blog comments powered by Disqus

Documentation generated on Sun, 19 Oct 2008 06:43:35 +1300 by phpDocumentor 1.3.2