Example #1
0
 static function borrowBook()
 {
     if (FALSE == self::$isLoanedOut) {
         if (NULL == self::$book) {
             self::$book = new BookSingleton();
         }
         self::$isLoanedOut = TRUE;
         return self::$book;
     } else {
         return NULL;
     }
 }
Example #2
0
 static function borrowBook()
 {
     if (false == self::$isLoanedOut) {
         if (null == self::$book) {
             self::$book = new BookSingleton();
         }
         self::$isLoanedOut = true;
         return self::$book;
     } else {
         return null;
     }
 }