diff options
| author | spiderr <spiderr@bitweaver.org> | 2021-02-13 18:48:17 -0500 |
|---|---|---|
| committer | spiderr <spiderr@bitweaver.org> | 2021-02-13 18:48:17 -0500 |
| commit | 67bf5e1d5ba517914374d793b1d9d59130904221 (patch) | |
| tree | 5eb3d49d3c41689ced843c8eff2883623ac549da | |
| parent | 182fda7f646d1cf7d8420065f57ef4a6eb30a5d2 (diff) | |
| download | liberty-67bf5e1d5ba517914374d793b1d9d59130904221.tar.gz liberty-67bf5e1d5ba517914374d793b1d9d59130904221.tar.bz2 liberty-67bf5e1d5ba517914374d793b1d9d59130904221.zip | |
result empty check
| -rw-r--r-- | includes/classes/LibertyStructure.php | 38 |
1 files changed, 19 insertions, 19 deletions
diff --git a/includes/classes/LibertyStructure.php b/includes/classes/LibertyStructure.php index 7cb5755..8456f37 100644 --- a/includes/classes/LibertyStructure.php +++ b/includes/classes/LibertyStructure.php @@ -73,30 +73,30 @@ class LibertyStructure extends LibertyBase { LEFT JOIN `'.BIT_DB_PREFIX.'users_users` uu ON ( uu.`user_id` = lc.`user_id` )' . $where; if( $result = $this->mDb->query( $query, $bindVars ) ) { - $ret = $result->fetchRow(); - } - - if( !empty( $contentTypes[$ret['content_type_guid']] ) ) { - // quick alias for code readability - $type = &$contentTypes[$ret['content_type_guid']]; - if( empty( $type['content_object'] ) && !empty( $gBitSystem->mPackages[$type['handler_package']] ) ) { - // create *one* object for each object *type* to call virtual methods. - $handlerFile = $gBitSystem->mPackages[$type['handler_package']]['path'].$type['handler_file']; - if( file_exists( $handlerFile ) ) { - include_once( $handlerFile ); - if( class_exists( $type['handler_class'] ) ) { - $type['content_object'] = new $type['handler_class'](); + if( $ret = $result->fetchRow() ) { + if( !empty( $contentTypes[$ret['content_type_guid']] ) ) { + // quick alias for code readability + $type = &$contentTypes[$ret['content_type_guid']]; + if( empty( $type['content_object'] ) && !empty( $gBitSystem->mPackages[$type['handler_package']] ) ) { + // create *one* object for each object *type* to call virtual methods. + $handlerFile = $gBitSystem->mPackages[$type['handler_package']]['path'].$type['handler_file']; + if( file_exists( $handlerFile ) ) { + include_once( $handlerFile ); + if( class_exists( $type['handler_class'] ) ) { + $type['content_object'] = new $type['handler_class'](); + } + } + } + if( !empty( $type['content_object'] ) && is_object( $type['content_object'] ) ) { + $ret['title'] = $type['content_object']->getTitleFromHash( $ret ); } } - } - if( !empty( $type['content_object'] ) && is_object( $type['content_object'] ) ) { - $ret['title'] = $type['content_object']->getTitleFromHash( $ret ); + + $sStructureNodeCache['structure_id'][$ret['structure_id']] = $ret; + $sStructureNodeCache['content_id'][$ret['content_id']] = $ret; } } - $sStructureNodeCache['structure_id'][$ret['structure_id']] = $ret; - $sStructureNodeCache['content_id'][$ret['content_id']] = $ret; - return $ret; } |
