| applications_smartshop

# Class: Bs_Ss_XAtom Source Location: /applications/smartshop/Bs_Ss_XAtom.class.php
### Class Overview
    Bs_Object
       |
       --Bs_Ss_XAtom
SmartShop XAtom Class (Abstaract Class) #### Author(s): andrej arn <at blueshoes dot org> Sam Blum <sam at blueshoes dot org> #### Version: 4.3.$Revision: 1.2 $ $Date: 2003/08/09 15:22:35 $ #### Copyright: blueshoes.org | ### Variables $fullTrace $_APP $_atomContainer $_failedReason $_tempContainer $_traceMsg $_xClearingHouse $_xStorage | ### Methods Bs_Ss_XAtom datetimeInRange getFailedReason getUid init isAlive persist reset toXml
### Child classes: Bs_Ss_SmartShop SmartShop Class Bs_Ss_XCategory SmartShop XCategory Class Bs_Ss_XProduct SmartShop XBlock Class | ### Inherited Variables | ### Inherited Methods #### Class: Bs_Object Bs_Object::Bs_Object() Bs_Object::getErrors() Basic error handling: Get *all* errors as string array from the global Bs_Error-error stack. Bs_Object::getLastError() Basic error handling: Get last error string from the global Bs_Error-error stack. Bs_Object::getLastErrors() Basic error handling: Get last errors string array from the global Bs_Error-error stack sinc last call of getLastErrors(). Bs_Object::persist() Persists this object by serializing it and saving it to a file with unique name. Bs_Object::setError() Basic error handling: Push an error string on the global Bs_Error-error stack. Bs_Object::toHtml() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::toString() Dumps the content of this object to a string using PHP's var_dump(). Bs_Object::unpersist() Fetches an object that was persisted with persist()
### Class Details [line 19] SmartShop XAtom Class (Abstaract Class) #### Tags:
copyright: | blueshoes.org
pattern: | singleton: (pseudostatic)
access: | public
version: | 4.3.$Revision: 1.2 $ $Date: 2003/08/09 15:22:35 $
author: | andrej arn <at blueshoes dot org> Sam Blum <sam at blueshoes dot org>
[ Top ] ### Class Variables #### $fullTrace = TRUE [line 82]
Type: | mixed
[ Top ] #### $_APP = [line 70] reference to the global ini settings #### Tags:
var: | (hash)
Type: | array
[ Top ] #### $_atomContainer = array( 'UID' => NULL, 'storageMedia' => NULL, 'fileExtension' => NULL, 'element' => NULL, 'isDataLoaded' => FALSE, 'alive' => array( 'isDeactivated' => FALSE, 'startDatetime' => '0000-00-00 00:00:00', 'endDatetime' => '0000-00-00 00:00:00' ),'cache'=>array('version'=>-1,'storageMedia'=>'file','xmlModTime'=>NULL,'absPathToXml'=>NULL,'absPathToXCache'=>NULL,),'bsHead'=>array('version'=>'1.0',),) [line 28] This will be serialized and stored in a xxxxx.xcache-file
Type: | mixed
[ Top ] #### $_failedReason = [line 77] vector telling why $this is not valid. #### Tags:
see: | Bs_Ss_XAtom::getFailedReason()
Type: | vector
[ Top ] #### $_tempContainer = array( 'isValid' => NULL , 'isAlive' => NULL, 'xmlFileFound' => FALSE, 'xCacheFileUptodate'=> FALSE, ) [line 55] This data will not be persisted
Type: | mixed
[ Top ] #### $_traceMsg = [line 87] array
Type: | mixed
[ Top ] #### $_xClearingHouse = [line 98]
Type: | mixed
[ Top ] #### $_xStorage = [line 93]
Type: | mixed
[ Top ] ### Class Methods ### constructor Bs_Ss_XAtom [line 104]
`Bs_Ss_XAtom Bs_Ss_XAtom( mixed $__file__)`
Constructor. [ Top ] ### method datetimeInRange [line 272]
`int datetimeInRange( [string $startDatetime = NULL], [string $endDatetime = NULL], [string $now = NULL])`
Tells if this element is ALIVE. That means if 'now-time' is between the start- and end-time of of this object. See $_atomContainer['alive']['startDatetime']; $_atomContainer['alive']['endDatetime']; above. The check may also be done with a time passed as 3rd parameter instead of using current gmt time. Everything in gmt. RETURN : start end ----------------|------------------------|-------------- -1 | 0 ] +1 now < start == -1 | ] end <= now == +1 NOTE I: If you pass at least the 2 first parameters, you may use this function static ($this is then not used). NOTE II: A valid datetime looks like "yyyy-mm-dd hh:mm:ss" and everything else gives wrong results. if for example startDatetime is empty or "0000-00-00 00:00:00" this means "there is none", thus "it is already active". The same applies for endDatetime "never expires". In a stupid situation it would even be possible that the datetime is too young AND too old. But this case is not detected. E.g. start:2005, end:1999, now:2001 you would get a -1 (expired) here. #### Tags:
return: | see above
access: | public
#### Parameters:
string | $startDatetime | (optional, default 'this start time') gmt "yyyy-mm-dd hh:mm:ss"
string | $endDatetime | (optional, default 'this end time') gmt "yyyy-mm-dd hh:mm:ss"
string | $now | (optional, default now) gmt "yyyy-mm-dd hh:mm:ss"
[ Top ] ### method getFailedReason [line 219]
`array getFailedReason( [mixed $verbose = FALSE])`
Tells what went wrong. see error-documents-howto.doc the vector has 3 elements. element 0 is the standard http error code, element 1 is the bs additional code, element 2 is for for additional information, if used at all. it is an array (hash or vector) and it may be empty. example: array(410, 1, array('datetime')); would mean that the page expired on 'datetime' and thus is gone. #### Tags:
return: | (vector)
see: | 2do
access: | public
Overridden in child classes as: Bs_Ss_SmartShop::getFailedReason() Bs_Ss_XCategory::getFailedReason() [ Top ] ### method getUid [line 153]
`void getUid( )`
[ Top ] ### method init [line 127]
`bool init( string $UID)`
Init this object using the UID (Unified ID) The UID is either numeric (ID of Db) or a string Overridden in child classes as: Bs_Ss_SmartShop::init() Init this object Bs_Ss_XCategory::init() Init this object using an UID it's either numeric (ID of Db) or a string set together of UNI (Unified Node ID) + core name (source name without version and extentions) Bs_Ss_XProduct::init() Init this object using an UID it's either numeric (ID of Db) or a string set together of UNI (Unified Node ID) + core name (source name without version and extentions) #### Parameters:
string | $UID | (see above)
[ Top ] ### method isAlive [line 304]
`bool isAlive( )`
Tells if something (page, node, block, whatever) with the given properties is alive or not. For alive it must be valid and 'now' must be between start- and end-time #### Tags:
see: | Bs_Ss_XAtom::datetimeInRange()
[ Top ] ### method persist [line 229]
`void persist( )`
Use the XStorage to persist any XAtom Overrides Bs_Object::persist() (Persists this object by serializing it and saving it to a file with unique name.) [ Top ] ### method reset [line 188]
`void reset( )`
Reset the whole object But keep the UID and perform a basic init [ Top ] ### method toXml [line 325]
`string. toXml( [bool $htmlOut = FALSE])`
Generate a XML output of the element (XCategory, XProduct) #### Tags:
return: | A XML representation of the element
#### Parameters:
bool | $htmlOut | (default FALSE). Will make a HTML viewable output; only for debugging or so
[ Top ] Documentation generated on Mon, 29 Dec 2003 21:12:51 +0100 by phpDocumentor 1.2.3