]> git.mxchange.org Git - shipsimu.git/blobdiff - application/ship-simu/main/user/extended/class_ShipSimuMember.php
Payment introduced, minor rewrites
[shipsimu.git] / application / ship-simu / main / user / extended / class_ShipSimuMember.php
index 25e76b7bbe54f7e861f30d11152f5b55d181501f..f2caaa8eee31ea0762f622922e2c175bdd92dcea 100644 (file)
@@ -28,18 +28,22 @@ class ShipSimuMember extends ShipSimuBaseUser implements ManageableMember {
         * @param       $className      Name of the class
         * @return      void
         */
-       protected function __construct ($className = "") {
-               // Is the class name empty? Then this is not a specialized user class
-               if (empty($className)) $className = __CLASS__;
-
+       protected function __construct ($className = __CLASS__) {
                // Call parent constructor
                parent::__construct($className);
+       }
 
-               // Set part description
-               $this->setObjectDescription("Special member class for Ship-Simu");
+       /**
+        * Destructor for e.g. flushing pending updates to the database
+        *
+        * @return      void
+        */
+       public function __destruct () {
+               // Flush any updated entries to the database
+               $this->flushPendingUpdates();
 
-               // Create unique ID number
-               $this->generateUniqueId();
+               // Call parent destructor
+               parent::__destruct();
        }
 
        /**
@@ -91,6 +95,7 @@ class ShipSimuMember extends ShipSimuBaseUser implements ManageableMember {
         *
         * @param       $requestInstance        An instance of a Requestable class
         * @return      $userInstance           An instance of this user class
+        * @todo        Add more ways of creating user instances
         */
        public final static function createMemberByRequest (Requestable $requestInstance) {
                // Determine if by email or username
@@ -140,8 +145,8 @@ class ShipSimuMember extends ShipSimuBaseUser implements ManageableMember {
                $updateInstance = ObjectFactory::createObjectByConfiguredName('update_criteria_class');
 
                // And add our both entries
-               $updateInstance->addCriteria('last_activity', date("Y-m-d H:i:s", time()));
-               $updateInstance->addCriteria('last_action', $lastAction);
+               $updateInstance->addCriteria("last_activity", date("Y-m-d H:i:s", time()));
+               $updateInstance->addCriteria("last_action", $lastAction);
 
                // Add the search criteria for searching for the right entry
                $updateInstance->setSearchInstance($searchInstance);