Changeset 6176
- Timestamp:
- 06/04/07 10:17:28 (1 year ago)
- Files:
Legend:
- Unmodified
- Added
- Removed
- Modified
- Copied
- Moved
trunk/midcom/midcom.helper.datamanager2/datamanager.php
r6087 r6176 221 221 * @param mixed $object A reference to either a MidCOM DBA class or a subclass of 222 222 * midcom_helper_datamanager2_storage. 223 * @param bool $strict Whether we should strictly use only the schema given by object params 223 224 * @return bool Indicating success. 224 225 */ 225 function autoset_storage(&$object )226 function autoset_storage(&$object, $strict = false) 226 227 { 227 228 if (is_a($object, 'midcom_helper_datamanager2_storage')) … … 239 240 } 240 241 241 if (! $this->set_schema($schema)) 242 { 243 return false; 242 if (!$this->set_schema($schema)) 243 { 244 if ( $strict 245 || $schema == null) 246 { 247 return false; 248 } 249 else 250 { 251 debug_push_class(__CLASS__, __FUNCTION__); 252 debug_add("Given schema name {$schema} was not found, reverting to default.", MIDCOM_LOG_INFO); 253 debug_pop(); 254 // Schema database has probably changed so we should be graceful here 255 if (!$this->set_schema(null)) 256 { 257 return false; 258 } 259 } 260 244 261 } 245 262 return $this->set_storage($object);
