Added is_object()

This commit is contained in:
abraar
2010-12-08 10:14:41 +00:00
parent d380899945
commit 3dd41e58ad
14 changed files with 23 additions and 23 deletions

View File

@@ -318,7 +318,7 @@ class pagedTable
else
trigger_Error('Warning: sql query is empty',E_USER_WARNING);
// Config attributes from XMLFORM file
$myAttributes=get_class_vars(is_object($this) && get_class($this));
$myAttributes=get_class_vars(get_class($this));
foreach ($this->xmlForm->xmlform->tree->attribute as $atrib => $value)
if (array_key_exists( $atrib, $myAttributes)){
eval('settype($value,gettype($this->'.$atrib.'));');
@@ -637,8 +637,8 @@ class pagedTable
$this->xmlForm->setDefaultValues();
$this->xmlForm->setValues( $result );
$this->xmlForm->fields[ $this->fields[$r]['Name'] ]->mode = 'view';
if ((array_search( 'rendergrid', get_class_methods(is_object($this) && get_class($this->xmlForm->fields[ $this->fields[$r]['Name'] ])) )!==FALSE)
||(array_search( 'renderGrid', get_class_methods(is_object($this) && get_class($this->xmlForm->fields[ $this->fields[$r]['Name'] ])) )!==FALSE)) {
if ((array_search( 'rendergrid', get_class_methods( get_class($this->xmlForm->fields[ $this->fields[$r]['Name'] ])) )!==FALSE)
||(array_search( 'renderGrid', get_class_methods( get_class($this->xmlForm->fields[ $this->fields[$r]['Name'] ])) )!==FALSE)) {
$htmlField = $this->xmlForm->fields[ $this->fields[$r]['Name'] ]->renderGrid( array($value) , $this->xmlForm );
$this->tpl->assign( "value" , $htmlField[0] );
} else {

View File

@@ -111,7 +111,7 @@ class WebResource
if (!function_exists('json_encode')) {
G::LoadThirdParty('pear/json','class.json');
function json_encode(&$value) {
$json=& new Services_JSON;
$json= new Services_JSON;
return $json->encode($value);
}
}
@@ -119,7 +119,7 @@ if (!function_exists('json_encode')) {
if (!function_exists('json_decode')) {
G::LoadThirdParty('pear/json','class.json');
function json_decode(&$value) {
$json=& new Services_JSON;
$json= new Services_JSON;
return $json->decode($value);
}
}

View File

@@ -194,7 +194,7 @@ class ymlTestCases
{
$results=array();
//$this->addToPlan( $count, $start );
$functions=get_class_methods(is_object($testerObject) && get_class($testerObject) );
$functions=get_class_methods( get_class($testerObject) );
foreach($functions as $id=>$fn)
$functions[$id]=strtolower($fn);
foreach($this->testCases as $index => $testCase){

View File

@@ -38,7 +38,7 @@ require_once "PEAR.php";
* methods, an instance of each class providing separated methods is
* stored and called every time the aggregated method is called.
*
* @author Stig S<>ther Bakken <ssb@php.net>
* @author Stig S<>ther Bakken <ssb@php.net>
*/
class PEAR_Autoloader extends PEAR
{
@@ -146,7 +146,7 @@ class PEAR_Autoloader extends PEAR
$classname = strtolower($classname);
reset($this->_method_map);
while (list($method, $obj) = each($this->_method_map)) {
if (get_class($obj) == $classname) {
if (is_object($obj) && get_class($obj) == $classname) {
unset($this->_method_map[$method]);
$ok = true;
}

View File

@@ -50,7 +50,7 @@ class Systems extends BaseSystems {
$con = Propel::getConnection(SystemsPeer::DATABASE_NAME);
try {
$oSystem = SystemsPeer::retrieveByPk( $SysUid );
if ( get_class ($oSystem) == 'Systems' ) {
if (is_object($oSystem) && get_class ($oSystem) == 'Systems' ) {
$aFields = $oSystem->toArray(BasePeer::TYPE_FIELDNAME);
$this->fromArray ($aFields, BasePeer::TYPE_FIELDNAME );
return $aFields;

View File

@@ -137,7 +137,7 @@ class AppDelegation extends BaseAppDelegation {
$con = Propel::getConnection(AppDelegationPeer::DATABASE_NAME);
try {
$oAppDel = AppDelegationPeer::retrieveByPk( $AppUid, $sDelIndex );
if ( get_class ($oAppDel) == 'AppDelegation' ) {
if (is_object($oAppDel) && get_class ($oAppDel) == 'AppDelegation' ) {
$aFields = $oAppDel->toArray( BasePeer::TYPE_FIELDNAME);
$this->fromArray ($aFields, BasePeer::TYPE_FIELDNAME );
return $aFields;
@@ -163,7 +163,7 @@ class AppDelegation extends BaseAppDelegation {
try {
$con->begin();
$oApp = AppDelegationPeer::retrieveByPK( $aData['APP_UID'], $aData['DEL_INDEX'] );
if ( get_class ($oApp) == 'AppDelegation' ) {
if (is_object($oApp) && get_class ($oApp) == 'AppDelegation' ) {
$oApp->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oApp->validate()) {
$res = $oApp->save();
@@ -193,7 +193,7 @@ class AppDelegation extends BaseAppDelegation {
try {
$oConnection->begin();
$oApp = AppDelegationPeer::retrieveByPK( $sApplicationUID, $iDelegationIndex );
if ( get_class ($oApp) == 'AppDelegation' ) {
if (is_object($oApp) && get_class ($oApp) == 'AppDelegation' ) {
$result = $oApp->delete();
}
$oConnection->commit();

View File

@@ -93,7 +93,7 @@ class AppThread extends BaseAppThread {
try {
$con->begin();
$oApp = AppThreadPeer::retrieveByPK( $aData['APP_UID'], $aData['APP_THREAD_INDEX'] );
if ( get_class ($oApp) == 'AppThread' ) {
if (is_object($oApp) && get_class ($oApp) == 'AppThread' ) {
$oApp->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oApp->validate()) {
$res = $oApp->save();

View File

@@ -733,7 +733,7 @@ class Event extends BaseEvent {
function Exists ( $sUid ) {
try {
$oObj = EventPeer::retrieveByPk($sUid);
return (get_class($oObj) == 'Event');
return (is_object($oObj) && get_class($oObj) == 'Event');
}
catch (Exception $oError) {
throw($oError);

View File

@@ -142,7 +142,7 @@ class Groupwf extends BaseGroupwf {
$con = Propel::getConnection(GroupwfPeer::DATABASE_NAME);
try {
$oPro = GroupwfPeer::retrieveByPk( $ProUid );
if ( get_class ($oPro) == 'Groupwf' ) {
if (is_object($oPro) && get_class ($oPro) == 'Groupwf' ) {
$aFields = $oPro->toArray(BasePeer::TYPE_FIELDNAME);
$this->fromArray ($aFields, BasePeer::TYPE_FIELDNAME );
$aFields['GRP_TITLE'] = $oPro->getGrpTitle();
@@ -170,7 +170,7 @@ class Groupwf extends BaseGroupwf {
try {
$con->begin();
$oPro = GroupwfPeer::retrieveByPK( $aData['GRP_UID'] );
if ( get_class ($oPro) == 'Groupwf' ) {
if (is_object($oPro) && get_class ($oPro) == 'Groupwf' ) {
$oPro->fromArray( $aData, BasePeer::TYPE_FIELDNAME );
if ($oPro->validate()) {
if ( isset ( $aData['GRP_TITLE'] ) )
@@ -234,7 +234,7 @@ class Groupwf extends BaseGroupwf {
$con = Propel::getConnection(GroupwfPeer::DATABASE_NAME);
try {
$oPro = GroupwfPeer::retrieveByPk( $GrpUid );
if ( get_class ($oPro) == 'Groupwf' ) {
if (is_object($oPro) && get_class ($oPro) == 'Groupwf' ) {
return true;
}
else {

View File

@@ -302,7 +302,7 @@ class InputDocument extends BaseInputDocument {
$con = Propel::getConnection(InputDocumentPeer::DATABASE_NAME);
try {
$oObj = InputDocumentPeer::retrieveByPk( $sUid );
if ( get_class ($oObj) == 'InputDocument' ) {
if (is_object($oObj) && get_class ($oObj) == 'InputDocument' ) {
return true;
}
else {

View File

@@ -781,7 +781,7 @@ class OutputDocument extends BaseOutputDocument {
$con = Propel::getConnection(OutputDocumentPeer::DATABASE_NAME);
try {
$oObj = OutputDocumentPeer::retrieveByPk( $sUid );
if ( get_class ($oObj) == 'OutputDocument' ) {
if (is_object($oObj) && get_class ($oObj) == 'OutputDocument' ) {
return true;
}
else {

View File

@@ -144,7 +144,7 @@ class ReportVar extends BaseReportVar {
$con = Propel::getConnection(ReportVarPeer::DATABASE_NAME);
try {
$oRepVarUid = ReportVarPeer::retrieveByPk( $sRepVarUid );
if ( get_class ($oRepVarUid) == 'ReportVar' ) {
if (is_object($oRepVarUid) && get_class ($oRepVarUid) == 'ReportVar' ) {
return true;
}
else {

View File

@@ -180,7 +180,7 @@ function swimlanesElementsExists ( $sSwiEleUid ) {
$con = Propel::getConnection(SwimlanesElementsPeer::DATABASE_NAME);
try {
$oSwiEleUid = SwimlanesElementsPeer::retrieveByPk( $sSwiEleUid );
if ( get_class ($oSwiEleUid) == 'SwimlanesElements' ) {
if (is_object($oSwiEleUid) && get_class ($oSwiEleUid) == 'SwimlanesElements' ) {
return true;
}
else {

View File

@@ -4,7 +4,7 @@
$response = $oJasper->ws_list("/");
if (get_class($response) == 'SOAP_Fault') {
if (is_object($response) && get_class($response) == 'SOAP_Fault') {
$errorMessage = $response->getFault()->faultstring;
}
else {
@@ -68,7 +68,7 @@
$result = $oJasper->ws_runReport($currentUri, $report_params, $output_params, $attachments);
// 4.
if (get_class($result) == 'SOAP_Fault') {
if (is_object($result) && get_class($result) == 'SOAP_Fault') {
$errorMessage = $result->getFault()->faultstring;
echo $errorMessage;