Definition at line 527 of file class_ShippingCompany.php. References BaseFrameworkSystem.__toString(), BaseFrameworkSystem.debugOutput(), getCompanyName(), and BaseFrameworkSystem.isClass(). Referenced by validateWorksContractShipType(). 00527 { 00528 // The type must be a string! 00529 $shipType = (string) $shipType; 00530 00531 // Debug message 00532 if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> fragt alle Werften ab, ob diese Schiffe vom Typ <strong>%s</strong> bauen können.", 00533 __CLASS__, 00534 __LINE__, 00535 $this->getCompanyName(), 00536 $shipType 00537 )); 00538 00539 // First everthing is failed... 00540 $result = false; 00541 00542 // Iterate through all shipyards 00543 for ($idx = $this->shipyardList->getIterator(); $idx->valid(); $idx->next()) { 00544 // Get current Shipyard instance 00545 $shipyard = $idx->current(); 00546 00547 // Is this a shipyard? 00548 if (is_null($shipyard)) { 00549 // Opps! Empty list? 00550 throw new NullPointerException($this, self::EXCEPTION_IS_NULL_POINTER); 00551 } elseif (!is_object($shipyard)) { 00552 // Not an object! ;-( 00553 throw new NoObjectException($shipyard, self::EXCEPTION_IS_NO_OBJECT); 00554 } elseif ($shipyard->isClass("Shipyard") === false) { 00555 // Class is not a shipyard 00556 throw new ClassMismatchException(array($shipyard->__toString(), "Shipyard"), self::EXCEPTION_CLASSES_NOT_MATCHING); 00557 } 00558 00559 // Validate if first found shipyard can construct the requested type 00560 $result = $shipyard->isShipTypeConstructable($shipType); 00561 00562 // Does this shipyard construct the requested ship type? 00563 if ($result) break; // Then abort the search! 00564 } // END - for 00565 00566 // Debug message 00567 if ((defined('DEBUG_COMPANY')) || (defined('DEBUG_ALL'))) $this->debugOutput(sprintf("[%s:%d] Die Reederei <strong>%s</strong> hat die Suche nach einer Werft beendet, die Schiffe vom Typ <strong>%s</strong> bauen kann.", 00568 __CLASS__, 00569 __LINE__, 00570 $this->getCompanyName(), 00571 $shipType 00572 )); 00573 00574 // Return result 00575 return $result; 00576 }
Here is the call graph for this function:
![]()
Here is the caller graph for this function:
![]()
|
1.5.6