*/
private $resultInstance = null;
+ /**
+ * Instance for user class
+ */
+ private $userInstance = null;
+
/**
* The real class name
*/
} elseif (is_array($args)) {
// Some arguments are there
foreach ($args as $arg) {
- // Check the type
- if (is_bool($arg)) {
- // Boolean!
- if ($arg) $argsString .= "true(bool)"; else $argsString .= "false(bool)";
- } elseif (is_int($arg)) {
- // Integer
- $argsString .= $arg."(int)";
- } elseif (is_float($arg)) {
- // Floating point
- $argsString .= $arg."(float)";
- } elseif ($arg instanceof BaseFrameworkSystem) {
- // Own object instance
- $argsString .= $arg->__toString()."(Object)";
- } elseif (is_object($arg)) {
- // External object
- $argsString .= "unknown object(!)";
- } elseif (is_array($arg)) {
- // Array
- $argsString .= "Array(array)";
- } elseif (is_string($arg)) {
- // String
- $argsString .= "\"".$arg."\"(string)";
- } elseif (is_null($arg)) {
- // Null
- $argsString .= "(null)";
- } elseif (is_resource($arg)) {
- // Resource
- $argsString .= "(resource)";
- } else {
- // Unknown type (please report!)
- $argsString .= $arg."(<em>unknown!</em>)";
- }
-
- // Add comma
- $argsString .= ", ";
- }
+ // Add the type
+ $argsString .= $arg." (".gettype($arg)."), ";
+ } // END - foreach
// Remove last comma
if (substr($argsString, -2, 1) === ",") {
}
/**
- * Updates a given field with new value
+ * Protected setter for user instance
*
- * @param $fieldName Field to update
- * @param $fieldValue New value to store
+ * @param $userInstance An instance of a user class
* @return void
- * @throws DatabaseUpdateSupportException If this class does not support database updates
*/
- public function updateDatabaseField ($fieldName, $fieldValue) {
- // Is updating database fields allowed by interface?
- if (!$this instanceof Updateable) {
- // Update not supported!
- throw new DatabaseUpdateSupportException($this, self::EXCEPTION_DATABASE_UPDATED_NOT_ALLOWED);
- } // END - if
-
- // Get a critieria instance
- $searchInstance = ObjectFactory::createObjectByConfiguredName('search_criteria_class');
-
- // Add search criteria
- $searchInstance->addCriteria(UserDatabaseWrapper::DB_COLUMN_USERNAME, $this->getUserName());
- $searchInstance->setLimit(1);
-
- // Now get another criteria
- $updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class');
-
- // And add our both entries
- $updateInstance->addCriteria($fieldName, $fieldValue);
-
- // Add the search criteria for searching for the right entry
- $updateInstance->setSearchInstance($searchInstance);
+ protected final function setUserInstance (ManageableAccount $userInstance) {
+ $this->userInstance = $userInstance;
+ }
- // Remember the update in database result
- $this->getResultInstance()->add2UpdateQueue($updateInstance);
+ /**
+ * Getter for user instance
+ *
+ * @return $userInstance An instance of a user class
+ */
+ public final function getUserInstance () {
+ return $this->userInstance;
}
}